Monday, 19 March 2012

How to run java on android? Step by step solution

What is the problem?
  1. How to install Java application on Android?
  2. Run Java Application on Android?
  3. Is Android support Java?
  4. Run Midlet J2ME on Java?
  5. J2ME emulator for Android?
  6. Is it possible to run Java on Android? (*yes it's possible)

This is a some of the simple question that haunted me for several weeks, but if you Google it, you will get outdated and you feel that most of the solution is not working. So please back link this or share this article if you think that's this solution help solve your problems.


Some of not working or incomplete solution



The first bet, you will find JBED Java emulator that will run on Android so that you can run Java Games and Midlet. The problems with JBED is that it's have not been updated to support android version 2.0 and above.

The installation is troublesome,  you need to modify some Android root to make it works.

Open the archive and move 'system/lib/libjbedvm.so' to /system/lib/libjbedvm.so to your device (with ADB or etc) then move 'system/app/Jbed.apk' to /system/app/Jbed.apk'

Most people got confuse with this type of instruction and finally give up.


I also give up after several failed attempt to install JBED on my Samsung Galaxy Tab 7.0 inch.

Secondly, i tried to netmite solution that claims can convert the Convert j2me MIDP (jad) into Android package (apk) automatically from the Web Interface. Well, i strongly feel that this web interface just don't works. It's just 0.001 probability that's it will automatically convert your java code into APK. I tried several times with a few Java JAR and JAD files to the netmite.com but i'ts always failed.

This netmite converter is not working. Give up after several tried.


Then, i started to think that, there is no way, that JAVA midlet can automatically run on Android. After searching for Midlet for JAVA, JAVA, or JAR in the Android market, i feel that it's never ever get supported by the Google Android.


How to run java application on Android?


Luckily, I found the true solution that gonna help you run Java application on Android. It's also work on Android 2.2 and above.

I m gonna show you step by step on how to run java , midlet , jar or jad files from your Android to prove the idea of running Java Application on Android without source code recompilation So, the first step is to Install Java emulator on  Virtual Box and download Android ISO to be specific. (You required at least Android version 2.2 to support JAVA. So download this version.
http://android-x86.googlecode.com/files/android-x86-2.2-generic.iso

Tips: From my testing, Android .

Why Android emulator on Virtual PC? Because, it's let you test and tried several Android version from your desktop PC. You also can install Android APK files to test your java application. It's also a good solution if you don't own real Android phone. :-)

Create New Virtual Machine Wizard, before boot, attach Android iso.


Note that there are two options available to run android without installation.
1. HDPI is for High Definition.
2. MDPI is for Medium Definition.
3 VESA Mode

(Here ‘H’ is used for ‘High’ & ‘M’ is used for ‘Medium’, And ‘DPI’ means ‘Dots Per Inch’ – a measure of screen pixel density)

*Make sure you choose Install Android x-86 to hardisk. Because we need to create fake SD- Card later on.

Step 1: Install Android on VirtualBox and Create Fake SD Card


Create new partion, set bootable and write then quit.


Choose Ext3 filesystem to format sda1:


Create Fake SD Card (sdcard.img 2GB). You probably can choose lower size to speed up installation.


Click and Drag Green Padlock to unlock.















No comments:

Post a Comment