If you want to make programs for BlackBerry PlayBook Tablet using html5 and javascript you have to download and install SDK. It’s quite simple and described in documentation quite well. But when you start compiling and deploying program to simulator things are getting quite complicated and very badly documented (at least at the time when this post is written). Even a program downloaded from Blackeberry tutorial doesn’t want to compile.
First of all, to compile a program, you have to compress all files of your project (usually those ate html, js, css files and images) into a single zip file. First mistake that you will make is adding whole folder to archive . This doesn’t work ;) You should archive only files. Secondly, there shouldn’t be any unnecessary files like eclipse’s .project or Mac-Os’s .DS-Store hidden files. If compiler will find some of them i zipped file – it will fail.
So here is a short tutorial how to get started developing for BlackBerry PlayBook Tablet using WebWorks (and not Adobe AIR) on MacOs without any software for money.
- Create folder where your programs will be stored. For this tutorial let’s call it “progs”
- Inside this folder you can create as many folders as you want. One folder per program. For example you can extract SketchBook example program that can be taken from BlackBerry tutorial page and rename that folder to “sb”. Just try using short folder names without spaces and any other unnecessary symbols, because compiler seems to not like such names.
-
Inside folder "progs" create file named "compile_deploy" and fill it with: #!/bin/bash dir="sb" #directory name path="/Users/Username/bbwp/" #path to SDK password="pass" #password set on emulator ip="172.16.220.135" #IP of emulator #do not edit from this point cd $dir find . -name '*.DS_Store' -type f -delete zip -r ../$dir.zip * cd .. "$path"bbwp $dir.zip "$path"blackberry-tablet-sdk/bin/blackberry-deploy -installApp -password $password -device $ip -package bin/$dir.bar
In the first part of file there are some variables that should be changed: directory in which is the program (“sb”), path to directory where SDK was installed, password set in emulator, IP address of emulator.
- Start terminal. go to “progs” directory and run command:
chmod a+x compile_deploy
- Now if you run
./compile_deploy
Script that we just created will remove all DS_STORE files, zip all files inside directory, compile progarm and deploy everything into emulator (which by the way should have been started before ;))
- Test your program :)
If you have any questions feel free to ask in comments.
You gave some hope there :) .. however, you haven’t mentioned what’s your environment. Are you using the Webworks Eclipse plug-in or the SDK which you run from the terminal..
Cheers
I’m using SDK from terminal :)
Thank for the information, I tried it and got an error “Bar file does not exist or not a file or I cannot read it: bin/sb.bar” what does that mean?