When building mobile websites, it can still be necessary to test on the BlackBerry mobile platform to ensure wide-spread compatibility. This has become more difficult than it should be, particularly if you're testing older versions of BlackBerry OS on Windows 7 x64. BlackBerry releases a separate simulator for each OS release, including minor-versions (ex. 5.0.0.484 and 5.0.0.451 are separate simulators). Also, BlackBerry simulators are strictly Windows-based, so no Mac OS X versions here. (I ran my simulators on Windows 7 Pro x64, running through Parallels 7 on Mac OS X Lion). What contributes to the difficulty of mobile web testing on older BlackBerry simulators (OS 5 or older) is the need for a BlackBerry Mobile Data Service simulator (MDS). The simulator for the latest version of BlackBerry OS, v7 (I did not test v6), does not need this extra simulator. Here's what you'll need (these instructions are specifically for Windows 7 x64):
- A BlackBerry Developer Zone account (free). Get one here.
- Java JDK 6 (not JDK 7 or greater). Get it here(opens in a new window).
- BlackBerry Email and MDS Services Simulator Package v4.1.4. Get it here(opens in a new window). You'll need a BlackBerry Developer Zone account.
- Any BlackBerry simulator you need to test on (I tested with versions 4.7.0.148 and 5.0.0.419). Get them here(opens in a new window). You'll need a BlackBerry Developer Zone account.
1. Install Java JDK 6. A standard installation is fine. 2. Install the BlackBerry Email and MDS Services Simulator Package. 3. With Windows 7 x64, there are a few changes that you will have to make for MDS to work. If you ran the standard installation, you should find the MDS files here: C:\Program Files (x86)\Research In Motion\BlackBerry Email and MDS Services Simulators 4.1.4. Otherwise, navigate to the folder where you installed MDS. You'll need to change the user permissions so that your account can write as well as execute files within it. If you know how to do this, you can ignore the detailed instructions below. Once you've found the MDS folder, right click it and select 'Properties'. In the popup, select the 'Security' tab (1), then click 'Edit' under the list of groups and users (2).
Another popup will open. Select the Users group (1). Below, you'll see the list of permissions for the Users group. Click 'Full control' (2). Click 'Apply' (3), then 'OK' (4). You may see a few popups asking for permission, click Yes through all of them. You should now be able to edit, write, and execute within the MDS folder.
4. Batch file tokens in Windows 7 are different then those in previous versions of Windows. Because of this, we'll have to edit the run.bat file in the MDS folder. You should be able to find the file here: C:\Program Files (x86)\Research In Motion\BlackBerry Email and MDS Services Simulators 4.1.4\MDS\run.bat. When you find it, right click on the file, and select edit. Notepad, or your favorite text editor, should open. You should see text that looks like this (highlighting is mine):
@echo offcall
setBMDSEnv
if ["%JAVA_HOME%"] == [""] goto noJavaHomeSet
start cmd /v:on /c "%JAVA_HOME%\bin\java" -classpath !BMDS_CLASSPATH!;!BMDS_CLASSPATH2! -Xmx512M -DKeystore.Password=password net.rim.application.ipproxyservice.IPProxyServiceApplication -log.console.dump
goto end
:noJavaHomeSet
start cmd /v:on /c java -classpath !BMDS_CLASSPATH!;!BMDS_CLASSPATH2! -Xmx512M -DKeystore.Password=password net.rim.application.ipproxyservice.IPProxyServiceApplication -log.console.dump
goto end
:end
You'll want to replace both instances of
!BMDS_CLASSPATH!;!BMDS_CLASSPATH2!
with
%BMDS_CLASSPATH%;%BMDS_CLASSPATH2%
Save the file, overriding the old version, and exit Notepad. Now try running MDS by navigating to the Start menu and finding MDS.
A Command Prompt should open and begin booting up the MDS server.
To test that the MDS server is in fact up and running and is connected to the Internet, open your browser, and navigate to localhost:8080.
5. Now that MDS is working, you should be able to connect to the internet through a simulator. Run the simulator you need to test on, and navigate to the browser. You should now be connected to the internet.
HOW TO RESET THE SIMULATOR: To reset the simulator in the event you get stuck on an error (as I did), simply delete the configuration files located at: C:\Users\USER\net\rim. The 'Reset' menu item in the 'Files' dropdown never worked for me.
Need a fresh perspective on a tough project?
Let’s talk about how RDG can help.