Building & simulating Blackberry apps with the Blackberry SDK on Mac OS X
Wednesday, Jun 2. 2010 – Category: Development, Rdio
As I recently blogged, I just started working at Rdio. Specifically I’m working on the Android app. A fair amount of code is shared between our Android & Blackberry app (since they both use a common platform of Java). Since I’ve been making changes to the Android code, I wanted to be able to build the Blackberry app to make sure I didn’t regress or break anything there.
I’ve got a shiny new MacBook Pro, and well… it just feels like sacrilege to be running Windows on this thing. So I set out to see if I could get the latest Blackberry SDK working on OS X. And… well, it works! Requisite screenshot:
I owe a huge amount to this blog post, which I used and simply updated and hacked around with the latest rev of the SDK… I can’t claim much creativity for my steps since it’s clearly a derivative of azizuysal’s work.
Downloads
- Eclipse 3.5 (I used the Eclipse IDE for Java Developers package)
- Blackberry SDK/JDE for Eclipse (As of the time of this writing, I got BlackBerryJDEPluginFull1.1.2.201004161203-16.exe)
- bb-ant-tools (I got bb-ant-tools-1.2.8-bin.zip)
- mpowerplayer (I got build 1185)
SDK & ant Setup
- Install Eclipse wherever. It doesn’t matter where.
- Create a Blackberry directory for your Eclipse workspace and to hold the SDK. I used /Users/stevel/ws/Blackberry.
- Launch Eclipse and specify that directory (/Users/stevel/ws/Blackberry) as your workspace directory.
- Launch a terminal and do the following:
- mkdir $HOME/ws/Blackberry/SDK
- cd /tmp
- unzip $HOME/Downloads/mpp-sdk-1185.zip mpp-sdk/osx/preverify/preverify
unzip mpp-sdk-1185.zip mpp-sdk/osx/preverify/preverify
- unzip $HOME/Downloads/BlackBerryJDEPluginFull1.1.2.201004161203-16.exe
- (this will create two directories: InstallerData & Windows)
- unzip InstallerData/Disk1/InstData/Resource1.zip “C/ABS10/Components/EclipsePlugin/1.1.2/EclipsePlugin/installer/InstallAnywhere/InstallerData/EJDE\ Plugins1ae15a8ca04czgiasf.jar”
- (this will create a retardedly long subdirectory path, as you can see)
- unzip C/ABS10/Components/EclipsePlugin/1.1.2/EclipsePlugin/installer/InstallAnywhere/InstallerData/EJDE\ Plugins1ae15a8ca04czgiasf.jar
- (this will create two subdirectories: features & plugins)
- rm -rf C_ InstallerData Windows features
- cd $HOME/ws/Blackberry/SDK
- mkdir net.rim.ejde.componentpack5.0.05.0.0.25
- cd net.rim.ejde.componentpack5.0.05.0.0.25
- unzip /tmp/plugins/net.rim.ejde.componentpack5.0.05.0.0.25.jar
- mv /tmp/mpp-sdk/osx/preverify/preverify components/bin
- chmod +x components/bin/preverify
- cd ..
- mkdir bb-ant-tools-1.2.8-bin
- cd bb-ant-tools-1.2.8-bin
- unzip $HOME/Downloads/bb-ant-tools-1.2.8-bin.zip
- rm -rf /tmp/plugins /tmp/mpp-sdk
- Now go back to Eclipse, and go to the Eclipse>Preferences menu
- Go to Java>Build Path>User Libraries and click New
- Enter “Blackberry 1.1.2″ as the library name.
- Click Add Jars and select $HOME/ws/Blackberry/SDK/net.rim.ejde.componentpack5.0.05.0.0.25/components/lib/netrimapi.jar
- Then select Javadoc location and choose the $HOME/ws/Blackberry/SDK/net.rim.ejde.componentpack5.0.05.0.0.25/components/docs/api directory
- Go to Ant>Runtime in the Eclipse preferences
- Under Global Entries, click Add External Jars
- Choose $HOME/ws/Blackberry/bb-ant-tools-1.2.8-bin/bb-ant-tools.jar
- Click Okay and save the Preferences
- Add $HOME/ws/Blackberry/SDK/net.rim.ejde.componentpack5.0.05.0.0.25/components/bin to your PATH via your .bashrc file
Building Hello World
- Follow the exact steps (heck, use his sample code) in the blog I linked to above. It works perfectly.
- Only hitch is make sure to update the jde.home & simulator.home properties in your build.xml to the right paths of course.
Running the Simulator
- Call me nuts, but I didn’t feel like install MacPorts. Instead, I built my own Wine from source. To do this, just follow the instructions here. I installed it to /usr/local.
- Grab winetricks and put it somewhere in your path (curl http://www.kegel.com/wine/winetricks > $HOME/bin/winetricks)
- Install various winetricks packages:
- gdiplus msxml3 msxml4 msxml6
- (yes really, I had to install all 3 for some reason. I have no idea why)
- cd $HOME/ws/Blackberry/SDK/net.rim.ejde.componentpack5.0.0_5.0.0.25/components/simulator
- cat 9550.bat | sed -e ‘s/^M//’ > 9550.sh
- note the ^M isn’t a literal ^M, it’s the ctrl code for <Return>, hit Ctrl-V and then the Return key to generate it.
- Edit the 9550.sh file and make it look like:
- #!/bin/sh
- cd “
dirname $0“ - /usr/local/bin/wine fledge.exe /app=Jvm.dll /handheld=9550 /session=9550 /app-param=DisableRegistration /app-param=JvmAlxConfigFile:9550.xml /data-port=0x4d44 /data-port=0x4d4e /pin=0x2100000A
- Fixup the 9550.xml file
- cat 9550.xml | sed -e ‘s/^M//’ > /tmp/foo
- mv /tmp/foo 9550.xml
Recent posts
- Gesture Lock
(Saturday, Nov 13. 2010 – 12 Comments) - ConnectIn 1.1.1 & HTC Sense UI
(Tuesday, Sep 28. 2010 – 38 Comments) - ConnectIn
(Saturday, Sep 25. 2010 – 62 Comments) - Proguard, Android, Ant, and 3rd party external JARs
(Wednesday, Sep 22. 2010 – 18 Comments)
Categories
- Android
- Cars
- ChinaBlog
- Code
- Computers
- Development
- Food
- Football
- Grommit
- Linkage
- Movies&TV
- Music
- Musings
- OpenSolaris
- OpenSource
- Outdoors
- Pets
- Photos
- Quotage
- Rdio
- Songbird
- Sun
- Travel
Grommit
Mozilla
OpenSolaris
- alan burlison
- bonnie corwin
- eric boutilier
- glynn foster
- jim grisanzio
- mark nelson
- mike kupfer
- planet opensolaris
- stephen hahn
Songbird
Archives
- November 2010
- September 2010
- August 2010
- June 2010
- May 2010
- February 2010
- January 2010
- December 2009
- October 2009
- September 2009
- August 2009
- June 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006
- October 2006
- September 2006
- August 2006
- July 2006
- June 2006
- May 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- August 2005
- July 2005
- June 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- November 2004
- October 2004
- September 2004
- August 2004
- July 2004
- June 2004
- May 2004
- April 2004
- March 2004
- February 2004
- January 2004
- December 2003
- November 2003
- October 2003
- September 2003
- August 2003
- July 2003
- June 2003
- May 2003
- April 2003
- March 2003
- February 2003
- January 2003
- December 2002
- November 2002
- October 2002
- September 2002
- August 2002
- July 2002
- June 2002
- May 2002
- April 2002
- March 2002

