phoneME for Android

The Android port of phoneME Feature and Advanced is merely a proof-of-concept that running J2ME applications and midlets on Android is possible. Check out the builds in the Downloads section (look for the apk Android packages).

Each build includes the phoneME VM and a Android frontend wrapper with JNI bindings to the VM. Have a look at some of the screenshots. Here is a discussion of the main issues that had to be resolved.

More information about the phoneME project and these two types of virtual machines can be found at https://java.net/projects/phoneme.



License

The phoneME software is copyright (c) 1990-2011 by Sun Microsystems, Inc. (now Oracle) and licensed under the GNU General Public License (GPL) version 2. The builds for Android based operating systems on this site are based on the phoneME software and includes code copyright (c) 2007-2013 by Davy Preuveneers released under the same GPLv2 license. More details about the changes made to the original code are available on this site.

HowTo Build

See the build instructions page over here for more details.

HowTo Run CLDC-based Applications

For CLDC-based applications, package the classfiles in a preverified JAR file. Copy the JAR file onto an SD card or use the Android adb SDK utility to push the JAR file onto your device. You need to create a textfile with .args file extension in which you specify all the VM parameters, e.g. '-cp /path/to/app.jar Main arg1 arg2 arg3'. Make sure you always specify the full path of the java archive starting from the root of the filesystem. Contrary to CDC, with CLDC you cannot execute a jar file directly as in '-jar /path/to/app.jar'. You need to specify the classpath and main class. Save the file e.g. as app.args

Run the CLDC Android application as follows: select this ARGS file on your SD card after clicking on the Open button, and tap the Run button.

HowTo Run CDC-based Applications

If you want to run a simple J2ME Foundation Profile application, package it as a JAR file with a manifest file having a Main-Class entry. Copy the JAR file onto an SD card or use the Android adb SDK utility to push the JAR file onto your device. Run the Foundation Profile-MIDP Android application, select the JAR file on your SD card by clicking on the Open button, and push the Run button. The application will be executed as in 'cvm -jar /path/to/app.jar'.

If you want to set optional java virtual machine parameters at the command line, create a textfile with .args file extension in which you specify all the VM parameters as explained above.

   

HowTo Run MIDlets

If you want to run a midlet copied onto the filesystem, make sure you have both the JAR and JAD file in the same directory (e.g. /sdcard/midlets), and that the MIDlet-Jar-Url entry in the JAD file is a local file reference to the JAR file rather than an external http url.

Follow the same steps as before but select the JAD file instead, and push the Run button.

Here is a screenshot of the Opera Mini 5 midlet and a few other ones running with the phoneME Advanced + MIDP dual stack within an Android 2.2 emulator:

   

JAD files are also associated with the Foundation Profile-MIDP Android application. Therefore, you can also use your browser to select an online JAD file to download and run the midlet. If you click on a JAD download link, a popup menu will appear and you need to choose the Foundation Profile-MIDP Android application:




The midlet (JAR and JAD file) will be cached onto the filesystem in the Android application's data space. If the JAR file of the midlet is quite big, the Android application may be a little unresponsive while downloading the file.

The midlet will also be added to the quicklaunch list of midlets. In this list you can easily select a midlet and then push the Run button to start the midlet:



Also be aware of the following:

  • I have only done limited testing. I don't have a real Android phone (only the Android emulator, and a port of Android 2.2 for a Windows Mobile device). Use at your own risk.
  • The phoneME VM is built as a native library. If it crashes or exits, it will also terminate the Android wrapper application.
  • Graphics and font sizes are optimized for a 800x480 display, and may be too big for smaller display resolutions.
  • Screen rotation for midlets, native JNI libraries, and probably several other features do not work.
  • The MIDP part does not include any JSR support for midlets to handle audio, video, sms, 3d, bluetooth, etc.