Java ME wireless on-device debugging

There is a geeky alternative to the common on device debugging process. You usually take a cable, connect your device to the computer and wait until Active Sync connects your device and your computer. After it your device appears in the Device Selector in the GUI and in the emulator -Xquery command output.
There is an other (a bit unusual and untested ;) ) way, that requires no cable, no Active Sync. You just needs a Windows Mobile device that supports Wi-Fi and that a Wi-Fi enabled computer or a wireless router. Here is a simple HOWTO.
  1. Install a Java(TM) ME runtime on your device. You can find it in the on-device/winmobile-arm subdirectory of your Java ME SDK 3.0 installation directory. More info about this in the previous blogpost.
  2. Make sure that your computer is running and somehow accessible via Wi-Fi. There is no difference between plugging it into Wi-Fi enabled router and starting an ad-hoc network on the computer.
  3. Turn the WiFi on your device on, write down it's IP address. (This can be different for different vendors and models a good point to start your search is START -> Settings -> Connections -> WLAN Settings -> Connection Status. Otherwise you should check documentation shipped with your device.)
  4. Check, that the phone is accessible from the computer. Run ping <IP_OF_THE_DEVICE> or tracert <IP_OF_THE_DEVICE>.
  5. Run the Sun Java CLDC Emulator runtime, that you have installed on device.
  6. Go to the bin subdirectory of SDK installation. Run device-address.exe add ip <IP_OF_THE_DEVICE> command here.
  7. Wait a few seconds, check that emulator.exe -Xquery output contains a newly connected device. (Or run the GUI shipped with the SDK and have a look at the Device Selector)
  8. Now you are done, the device should work as any other device or emulator. You can for example run emulator.exe -Xdescriptor:../apps/FPDemo/dist/FPDemo.jad -Xdevice:<NAME_OF_THE_DEVICE_FROM_XQUERY> that installs an example midlet on the device. For debbuging you can use NetBeans Mobility or run emulator.exe -Xjam:install=<YOUR_JAD> -Xdevice:<NAME_OF_THE_DEVICE_FROM_XQUERY> -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=12345,suspend=n and connect any debugger to the port 12345

And some smaller tips at the end:

  • if you use a wireless router, you probably can configure it's DHCP server to provide all the time the same IP to your device. In such a situation, you don't need to run the device-address command every time. Your device is detected and connected every time, it appears in the wireless network.
  • it is possible to connect multiple phones to the computer at the same time. It is great for debugging on several different devices.
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Java ME Platform SDK is a toolbox for developing mobile applications. Java ME SDK Download

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today