Skip to content

Commit

Permalink
Update readme for new build stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Johnson committed Aug 26, 2010
1 parent f59ac60 commit ecd0669
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,36 @@ Pre-requisites
Your best bet is to check the PhoneGap wiki for detailed
installation and setup instructions:
http://phonegap.pbworks.com/Getting+Started+with+PhoneGap+(BlackBerry)
You will most definitely need Windows, Eclipse 3.5+, BlackBerry Eclipse Plugin, BlackBerry Eclipse Component
Packs, Ant, Ant-Contrib, and BB Ant Tools.

Create a PhoneGap project with Eclipse
Building PhoneGap BlackBerry Projects
-------------------------------------------------------------
1. Launch Eclipse, go to File->Import->Existing BlackBerry project.
2. Navigate over to where you cloned the git repo, and point it to the phonegap.jdp file located in blackberry/framework/.

In general the process of building a PhoneGap app consists of building the PhoneGap BlackBerry library
and loading that onto your device / simulator and then building your BlackBerry with your main
UiApplication class inheriting from com.phonegap.PhoneGap. Here are the details.

1. Clone the PhoneGap repository.
2. Edit the common.properties and project.properties files in phonegap-blackberry/framework. The paths in common.properties need to match your environment setup and the project.properties defines your project name etc. Most important of these is to point jde.home in common.properties to point to one of the Eclipse component packs that you have already installed (e.g. C:\\Program Files\\eclipse\\plugins\\net.rim.ejde.componentpack4.7.0_4.7.0.57\\components)
3. Open up a command prompt at the phonegap-blackberry folder.
4. Run 'ant' and see all the options you have. If your jde.home path is not correct you should see an error about it.
5. Run 'ant create -Dapp.name=MyApp -Doutput.dir=My/Relative/App/Dir -Dpackage=com.foobar' from the command-line. It will build the PhoneGap BlackBerry lib, create a new phonegap.js file and create a new project folder in the output.dir folder. The project folder could then be opened in Eclipse if it is so desired (see below).
6. From the command prompt again change to the output.dir folder where you can now run 'ant load-simulator' and that will build your new application and load it (along with the PhoneGapBlackBerryLib.cod) on the default simulator. There are other tasks that you can also run:
a) 'ant sign': Runs the 'build' task first, and then runs the signature tool on the compiled binary. Make sure to specify the 'password' property at the top of the build.xml file, otherwise the signature tool will fail!
b) 'ant load-simulator': Runs the 'sign' task first, then copies the signed binaries over to the simulator directory you specified at the top of the build.xml and finally runs the simulator. You should see your application under the BB Menu -> Downloads.
c) 'ant load-device': Runs the 'sign' task first, then executes the javaloader tool to load the signed binaries onto an attached (via USB) device.

Building PhoneGap BlackBerry Projects from Eclipse
-------------------------------------------------------------

If you want to run things from Eclipse you can do that too. Of course it helps a lot with debugging.

1. Launch Eclipse, go to File->New->BlackBerry project.
2. Choose "Use Existing Source" and navigate to the folder that you specified as the output.dir in step 5 above.
3. Modify the contents of the "www" directory to add your own HTML, CSS and Javascript.
4. Before running, right-click on project root and make sure 'Activate for BlackBerry' is checked.
5. Run or debug from Eclipse as desired.
4. Create a linked folder in the src folder to the www folder, this is important otherwise Eclipse will not deploy your www folder to the device / simulator.
5. Run or debug from Eclipse as desired. NOTE: Whatever simulator or device you are running / debugging on must have the PhoneGapBlackBerryLib.cod on that device - this is most easily achieved by running 'ant load-simulator' or load-device as in step 6 above.
6. When you are satisfied with the application, make sure you sign it! (BlackBerry menu -> Request Signatures)
This step needs to be done every time you change your source code. If you are running in simulator, you do not need
to sign your binaries - it is only necessary for deployment to actual devices.
Expand All @@ -28,18 +50,4 @@ Create a PhoneGap project with Eclipse
javaloader -u load path/to/codfile.cod
The -u parameter specifies loading via USB.
c) Over-the-air installation. Set up your application .jad, .jar and .cod files onto a web server. See RIM's documentation
for more details or this succinct PDF for info: http://assets.handango.com/marketing/developerTeam/BlackBerryOTADeployment.pdf

Building PhoneGap BlackBerry Projects with Apache Ant
-------------------------------------------------------------
You'll need all the prerequisites listed by BB Ant Tools (http://bb-ant-tools.sourceforge.net/) and Ant-Contrib. Both are in the phonegap-blackberry/util folder. If you want access to building using Ant from Eclipse,
check out http://www.slashdev.ca/2007/05/30/blackberry-development-with-ant-eclipse/ for instructions on how to do it.

1. Clone the PhoneGap repository.
2. Edit the common.properties and project.properties files in phonegap-blackberry/framework. The paths in common.properties need to match your environment setup and the project.properties defines your project name etc.
3. Open up a command-line to the phonegap-blackberry folder.
4. Run 'ant create -Dapp.name=MyApp -Doutput.dir=My/Relative/App/Dir -Dpackage=com.foobar' from the command-line. It'll build the PhoneGap BlackBerry lib and create a new phonegap.js file to be used in your BlackBerry application and create a new project folder in the output.dir folder. The project folder could then be opened in Eclipse if it is so desired.
5. From the command-line again change to the output.dir folder where you can now run 'ant load-simulator' and that will build your new application and load it on the default simulator. There are other tasks that you can also run:
a) 'ant sign': Runs the 'build' task first, and then runs the signature tool on the compiled binary. Make sure to specify the 'password' property at the top of the build.xml file, otherwise the signature tool will fail!
b) 'ant load-simulator': Runs the 'sign' task first, then copies the signed binaries over to the simulator directory you specified at the top of the build.xml and finally runs the simulator. You should see your application under the BB Menu -> Downloads.
c) 'ant load-device': Runs the 'sign' task first, then executes the javaloader tool to load the signed binaries onto an attached (via USB) device.
for more details or this succinct PDF for info: http://assets.handango.com/marketing/developerTeam/BlackBerryOTADeployment.pdf

0 comments on commit ecd0669

Please sign in to comment.