2

How can i convert a J2ME application which is using lwuit library to an android apk ?

I tried to convert using mircoemulator but when I start the application it shows error and exits.

aNi
  • 1,359
  • 11
  • 17

2 Answers2

6

Read this article, LWUIT for Android. Here clearly telling about How to do LWUIT with Android. Follow the stpes carefully and change the your MIDlet code. Just checkout the LWUIT-Incubator repository and use this for android development with LWUIT. Also read the README_Android.txt on this repository.

bharath
  • 14,283
  • 16
  • 57
  • 95
0

There's no way to make a direct conversion. Strictly speaking, you can make a port, adapting the code, or use some emulator or wrapper to run the CLDC/MIPD classes.

The guys in Opera also used MicroEmulator for OperaMini.

Mister Smith
  • 27,417
  • 21
  • 110
  • 193
  • Mister, Its possible. Because they created [`LWUITActivity.java`](http://java.net/projects/lwuit-incubator/sources/svn/content/trunk/thorsten_s/android/com/sun/lwuit/impl/android/LWUITActivity.java?rev=163) for running the MIDlet application on Android mobiles. I done a lot of applications without any issues. :) – bharath Sep 13 '11 at 12:22
  • I was not talking on just adapting the GUI. I was talking about adapting JavaME code to Android in a general. – Mister Smith Sep 13 '11 at 12:57
  • In general we cant run directly on Android. We need to use some convertor. But If we develop the Java ME application using LWUIT means we can run that application on Android. Before that we need to change some code. – bharath Sep 13 '11 at 13:16
  • Do you know any converter other than microemu and netmite ? – aNi Sep 13 '11 at 13:52
  • @bharat Agree, porting J2ME to Android is not that easy. You have to deal with things like RMS storage, or reading params from jad, or taking a snapshot via MMAPI, etc. – Mister Smith Sep 13 '11 at 16:21
  • That's y i said need to change some code. Some core API we cant use directly. – bharath Sep 14 '11 at 05:31
  • @aNi You are using LWUIT. So no need to use convertor for this. just do some kind of changes for android platform. – bharath Sep 14 '11 at 06:47
  • 1
    LWUIT4IO adds support for Storage (RMS), FileSystem and HTTP networking in a way that is portable between RIM/Android & J2ME with no code duplication. Using a J2ME converter will result in an application that look inferior and performs badly. Furthermore, LWUIT on android has native in place editing and ability to integrate with native platform features. Bharath's answer above is the correct one and should be marked as such. – Shai Almog Sep 15 '11 at 03:34
  • @Shai I didn't know about that functionality. Just readed in your blog XD. However I'm a big fan of native apps. And I don't see any reason to support J2ME any longer. – Mister Smith Sep 15 '11 at 07:24