how to test a local web application in blackberry simulator

Main menu:

Topics

Recent Posts

Blog

 

August 2009
M T W T F S S
« Jul   Sep »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Past Posts

Java/J2EE

JDBC

Other

how to test a local web application in blackberry simulator

August 16th, 2009 by Jeanne Boyarsky

Surely there must already be a tutorial on this, but I didn’t see one.  I did see this information scattered amongst various places.  So here it is in one place.

My goal

Make JavaRanch’s JForum implementation more mobile friendly.  It’s not too bad on the iPhone because the iPhone has a better browser.  On the BlackBerry, the forums are much more difficult to use than they need to be.  As a result I plan to starting out by testing a mobile stylesheet with the BlackBerry simulator.  I found an online iPhone simulator.  After the mobile stylesheet looks on the BlackBerry simulator, I can upload it to a test server and try with the iPhone one online.

Note: I didn’t install the BlackBerry Eclipse plugin because I’m not doing BlackBerry development.  If you want the plugin, I did come across a very detailed tutorial.

Steps to bring up app in BlackBerry simulator

  1. From the BlackBerry download site, download both the simulator and the MDS package.  You need the later in order for the simulator to do internet.  If you have a slow connection, note that both are large downloads.  The simulator is 82 MB and the MDS is 45 MB.  (Note to RIM: if one is already running Tomcat, it would be nice to distribute this as a web app.  Smaller download, no need to change to port and less of a memory hog.)
  2. If you are already using port 8080 (such as to run your own Tomcat server.) Open the file “..\Research In Motion\BlackBerry Email and MDS Services Simulators 4.1.2\MDS\config\rimpublic.property” and change the “WebServer.listen.port” property from 8080 to 8081.  Thank you BlackBerry message board for this tip.
  3. Launch the MDS
  4. Launch the BlackBerry Simulator
  5. Launch your local Tomcat
  6. Test away.  Note that you must use your computer name rather than localhost.  (On windows this is the %COMPUTERNAME% property.)  Thanks to ASP forum for this tip.

Actually using the simulator

Some impressions of using the simulator:

  • It defaults to “100%” view.  100% of what?  No BlackBerry is that big!  On a 1024×768 resolution, the screen and keys don’t both fit on the screen.  I immediately switched to 50% view which is about an inch longer than an actual BlackBerry.
  • Luckily the keyboard works without having to click on the simulated device keyboard.
  • All the buttons have a real keyboard shortcut which you can see when mousing over the simulated key.  This helps with frequent operations.
  • To use the scroll wheel, you have to click and drag.  I would have expected mouse gestures to work here because they are more similar to what you do on the device.  Luckily there is a keyboard shortcut for this (hold F9 and use arrows to your heart’s content.)
  • It grays out if you don’t use it for a few minutes.  As does the real BlackBerry.  This is a bit annoying when testing though.
  • Luckily you can paste in from the real system clipboard – useful for testing URLS

Now that I’ve gotten used to the simulator, the site is just as hard to use on the simulator as it is on a real BlackBerry.  Perfect!  That means it suits my needs.

Problems/error messages I encountered

Since most people look for a “problem/solution”, I’m also listing the surprises in that format.  I know that’s what I was looking for!  I didn’t think I’d need a tutorial on setting up a simple piece of software.

  • BlackBerry simulator hangs when I try to access the internet – check you have installed the MDS, turned it on and you don’t have a port conflict
  • 8080 in use when starting MDS – see step #2 and change the port #
  • 403 error accessing localhost – see step #6 and use the computer name
  • Fledge.exe is using a lot of memory – this is the blackberry simulator itself; not much you can do here

The goal

I saw just how bad things look.  There’s a few more steps before actually making it look better – like getting rid of the table based layout.  But I did make progress with the tool support!

Comments

Comment from Brian Evans
Posted: August 25, 2009 at 3:00 pm

Thanks so much! This was very useful. Is the rendering of web pages exact?

Comment from Jeanne Boyarsky
Posted: August 26, 2009 at 9:25 pm

Brian,
It’s real close as far as I can tell. In particular, all the little annoyances from the BlackBerry handheld are found on the simulator!

Pingback from how to test a local web application in droid simulator | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
Posted: January 2, 2010 at 9:34 pm

[...] August, I blogged about how to use the blackberry simulator because information was so scarce.  I’m happy to say the Android emulator documentation is [...]

Pingback from javaranch forums go mobile | Down Home Country Coding With Scott Selikoff and Jeanne Boyarsky
Posted: January 3, 2010 at 1:20 pm

[...] tested locally using the BlackBerry simulator and later with the Droid emulator. I also tested using my real BlackBerry after deploying to the [...]

Comment from Kimberley Ross
Posted: February 18, 2010 at 5:51 pm

Great post! Thank you!

I also learned that removing the .dmp files from the simulator directory solves web access issues.

Comment from Srikanth
Posted: April 15, 2010 at 1:52 am

Thanks, i want to how liferay portal looks on simulator.

Comment from Evan McDaniel
Posted: August 18, 2011 at 1:44 pm

Thanks for the tips. The F9 scroll is a lifesaver! :)

Write a comment