Friday, November 12, 2010

BlackBerry,Netbeans & LWUIT Sample

Hi, this post will try to guide you to develope an BlackBerry+LWUIT easy sample using Netbeans 6.9.

I was looking for a simple step by step guide to do it, but i found that many resources were removed, making the learning a little hard. But here i present a very simple and functional tutorial about this, enjoy it...

1. Download the JDE versions, I recommend 4.7.x (for Storm support).

2. Download Netbeans 6.9.

3. Download BB AnT Tools, make sure you are using Ant 1.7 or higher.
This will provide support for tasks like:
  • rapc
  • sigtool
  • alx
  • jadtool
4. Unzip and copy the file "bb-ant-tools.jar" to the ${Netbeans-home}/java/ant/lib directory.

5. Fetch the LWUIT sources from SVN and open the BlackBerry project. Clean & Build the project (notice that you MUST clean & build, a plain build will often fail since the RIM port needs to replace some classes from LWUIT).

6.
Remove: com.sun.lwuit.animations.Transition3D.java file from the LWUIT MIDP source code and clean & build.
6.1. This is important, because, Blackberry doesn't support M3G classes.

6.2. Or if don't want to remove that file,
try to look for preverify task, then you can do a bit of testing and ensure that it doesnt preverify the library. Netbeans ant plugin is a pretty simple setup and you can change it which ever way you want to.

7. Clean & Build the BlackberryPort (BlackberryPort is within the LWUIT source code, both LWUIT and BlackberryPort are netbeans projects).
8. Download helloLwuit demo project (this is copy with a little variation of the file provided by
Steve Zhang's blog).

Try it...


References
http://lwuit.blogspot.com/2009/11/building-project-on-blackberry.html
http://code-dojo.blogspot.com/2010/05/ant-build-script-for-lwuit-blackberry.html
http://stackoverflow.com/questions/2578403/error-preverifying-class-netbeans-6-8-using-lwuit-api

No comments: