Monday Oct 26, 2009

If you are running Java ME SDK 3.0 Early Access for Mac OS X you might experience preverify problem and got VERIFIER ERROR message. To fix it run following command in /Applications/Java_ME_SDK_3.0.app/Contents/Resources/bin path:

lipo preverify -output preverify -extract i386

It leaves only 32-bit version in the preverify file and takes out the 64-bit version.

Tuesday Oct 13, 2009

There is a new component device-manager in Java ME SDK 3.0 which is a cornerstone of the SDK. It runs in background and only a small icon in notification are on taskbar shows that it is up and running. It keeps running even if you're not working with Java ME SDK and it's launched along with start of the system. Not very nice ... You can easily get rid of autostart just open regedit and remove entry "Java(TM) ME Platform SDK 3.0" under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

Tuesday Jul 14, 2009

Have you started Java ME SDK 3.0 and see a small icon in the bottom right corner?

Update Notification

It appeared there about a month ago and some of you maybe asked what it means. The icon notifies you about available updates for Java ME SDK. This is a new feature in 3.0 release and allows delivery of updates faster than regular releases.

It is very easy and simple to install new updates, just click on the icon and follow instructions.

This first update contains updates of BD-J libraries from HDcookbook project and a few small fixes in Blu-ray development support. During the updating process you can see a message that plugins are signed but not trusted. You can trust them. This issue is also solved in the update and if you install the update this warning will not appear again in the future for next updates.


Wednesday Jun 24, 2009

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.

Friday May 29, 2009

Each emulator has 2 instances by default in Java ME SDK. For example DefaultCldcPhone has 2 instances DefaultCldcPhone1 and DefaultCldcPhone2. Developers ussualy don't need to run more than 2 instances simultaneously, but if it's necessary you can easily add new instances.

  1. go to toolkit-lib/process/device-manager/device-adapter/DefaultCldcPhone and copy file 2.bean into 3.bean, 4.bean etc.
  2. edit new bean to contain name of DefaultCldcPhone3 and link to DefaultCldcPhone3.properties
  3. go to toolkit-lib/process/device-manager/conf and copy DefaultCldcPhone.properties into DefaultCldcPhone3.properties
  4. stop device-manager and remove <userhome>/javame-sdk/3.0/work
  5. start again device-manager
Now you should have more instance of the same emulator. 

 

 

Monday May 25, 2009

Java ME SDK 3.0 supports offline profiling. Data is collected during the emulation session. After you close the emulator a profiler data snapshot is written to a .prof file which you can load and view in the SDK.

Since last Friday it is possible to load and view Java ME SDK profiler file also in VisualVM 1.1. VisualVM is a tool to monitor and troubleshoot Java applications. For more information about VisualVM visit its homepage.

How to view Java ME SDK profiler file in VisualVM? It's easy. Everything you have to do is to install Java ME Profiler Snapshot Viewer module from VisualVM update center.

  1. Start VisualVM.
  2. Open Plugins manager from Tools->Plugins menu.

    Tools->Plugins menu

  3. In Available Plugins tab select Java ME Profiler Snapshot Viewer and click Install button.

    VisualVM Update Center


When the module is installed, new action Import Java ME SDK Snapshot... is added to the application File menu.

Import Java ME SDK Snapshot...

Java ME SDK profiler file can be opened and shown in VisualVM by this action. Default location of Java ME SDK profiler file is <user_home>/javame-sdk/3.0/work/<device_number>/data.prof.

Tuesday May 05, 2009

We've made a plugin for phoneME developers which helps to integrate their custom builds into Java ME SDK. PhoneME plugin is available on sdk autoupdate. A short notice will popup automatically when sdk is started or go to Tools -> Plugins and look for Java ME SDK 3 binding to PhoneME MR4. Choose to install plugin if you are phoneME developer and you're building your own virtual machine (VM). The plugin itself doesn't contain phoneME VM it's expected that developer will install the one which he build himself. Instructions are provided with the plugin. Here they are summarized with some more details added:

First, install phoneME plugin from autoupdate. Two additional emulator instances named DefaultPhoneMEPhone1 and DefaultPhoneMEPhone2 will be created in sdk. They are bound to new runtime which can be found in SDK_INSTALL_DIR/runtimes/phoneME Although if you look there the runtime is almost empty. Emulator can't run with default phoneME runtime you will need to use latest phoneME Feature release MR4 and modify your build in order to use jmesdk-odt.jar library delivered in plugin. Following are instructions how to update your phoneME makefile:

  1. Add variable: SDK_INSTALL_DIR=<path-to-javame-sdk-install-dir>
  2. Set following switches for midp component: PRECOMPILED_ODD=true and ODD_JAR=$(SDK_INSTALL_DIR)/runtimes/phoneME/jmesdk-odt.jar
  3. Add install rule which will install phoneME runtime into sdk:  cp -r $(BUILD_OUTPUT_DIR)/midp/SDK/runtimes/cldc-hi/* $(SDK_INSTALL_DIR)/runtimes/phoneME

Now phoneME emulator can be launched with your customized phoneME runtime. Congratulations ;) It can be used from a command line or from Java ME SDK User Interface (UI). If you use UI both phoneME emulators appear in the device selector under a node named Phone ME Feature. If you prefer a command line, a device name must be specified through an option: -Xdevice:

Here is an example:

emulator.exe -Xdescriptor:../apps/Demos/dist/Demos.jad -Xdevice:DefaultPhoneMEPhone1

Here is also basic troubleshooting:

  1. Stop device manager
  2. Delete work directory in Java ME SDK users directory <windows-userhome>/javame-sdk/3.0/work
  3. Start <javame_sdk_install_dir>/bin/device-manager.exe. New work directory will be recreated.

Wednesday Apr 29, 2009

I would like to highlight an important behavior of  Java ME SDK here which might be useful to any developer. You don't need to exit from emulator fully, exit only your MIDlet and redeploy new one into already running emulator. This will increase your productivity because of saving time on emulator restarts. I use it always and it's real help.
Unfortunately this feature stays often undiscovered. Give it a try ...
I usually run emulator once without specifying a MIDlet - only to open AMS.

emulator.exe -Xjam

and then deploy my application again and again without exiting emulator - just exiting from a MIDlet.

emulator.exe -Xdescriptor:..\apps\Demos\dist\Demos.jad

Several things happen behind the scenes. MIDlet is deployed, launched and after exit it is removed. It works from command line and from UI and for real device as well.

Friday Apr 24, 2009

Java ME SDK 3.0 integrates CLDC, CDC and Blu-ray Disc Java (BD-J) technology into one SDK. BD-J is a new member of Java ME SDK family ... so it is the right time to try it and create your first Blu-ray Disc Application. How to do it? It's easy, just follow this tutorial.

Monday Apr 20, 2009

Java ME SDK fails to start on Vista 64-bit with 64-bit JRE. This can be workarounded by using 32-bit JRE on 64-bit Vista. So far, it looks that workaround works well.

When JME SDK device manager starts for the first time it creates emulator instances under <user_home>/javame-sdk/3.0/work. If something bad happens to instances settings and emulator does not start the first aid is:

  1. stop device manager
  2. delete working directory <user_home>/javame-sdk
  3. launch <sdk_install_dir>/bin/device-manager.exe
Emulator instances will be recreated in its default state.

This blog copyright 2009 by Radko Najman