By default, Google Android uses the Java VM, which can’t run on Windows Phone 8.1, Windows Phone 7, or Windows Phone 6.1.
This means that for most apps, you’ll need to use a custom VM running on a Windows Phone or Mac.
Fortunately, you can install an Eclipse-based Java VM on Android devices running Windows Phone, Mac, and Linux.
In fact, Eclipse gives you the option to run your app in the Java Virtual Machine (JVM) on Android.
Here’s how to get started.
Install Eclipse 2.
Open Eclipse 3.
Create an Android project (this example uses the MyApp project from Eclipse) 4.
Create a Java app (this project is a bit more complicated because it has an Android file name) 5.
Select the “Java” subdirectory in the Eclipse Project Wizard 6.
Click “Next” to begin installing Eclipse 7.
Click on the “Android” button next to “Platform” 8.
Click the “Build” button to begin building the app 9.
Eclipse will ask you for your Eclipse ID and pass it along to the Android build tool.
Once Eclipse finishes building, click on the Eclipse button to finish installing it 11.
Eclipse is now installed on the Android device, and you can run the app on it.
The JVM is a pretty straight forward setup, but it’s not without its quirks.
Eclipse’s “JVM” section of the IDE is a little different from the Eclipse Platform Wizard, which has an “Android SDK” tab that lets you specify the version of Android SDK that you want to use for your app.
The Eclipse Platform wizard provides a few additional options to get you started with Android development: 1.
Use Eclipse’s IDE on Windows or Mac devices.
This is a great option if you have a Windows or Windows-based Mac that doesn’t run Windows XP or later versions of Windows.
If you’re using a Mac, you’re going to need to enable cross-platform development and then enable cross platform debugging on your device.
Run your Java app in Eclipse.
This one’s a bit trickier because it requires Eclipse to run on your Android device and run in the Windows VM.
For this example, I’m using the MyApps project from the official Eclipse project repository.
Enable cross-compilation on your emulator.
This option is a tad tricky because it involves creating an Android class file and then loading it into Eclipse’s Java class loader.
Eclipse supports this on Windows, MacOS, and Ubuntu.
Use the Java IDE on Linux and other operating systems.
Eclipse has a version of the Java platform that it can run on.
This allows developers to use the Java Platform SDK and Java Tools to build Android applications.
It’s worth noting that for Android apps on Linux, Eclipse can run Android apps using a Java Virtual Device.
Install the Java Runtime Environment (JRE) on your Windows or Linux computer.
Eclipse ships with the JDK, which is a set of libraries and tools that allow developers to write native applications on Windows.
Eclipse doesn’t support any of the popular Windows-only libraries, like XAML and CSS.
The only way to install the JDRE on Windows and Linux is through the Windows Runtime Installer, which requires an account on Windows 7 or higher.
Create your Android app.
Eclipse comes with a Java IDE that you can use to write your app, but you’ll have to provide a name for the app.
For my project, I created a name “MyApp” and a project directory called “MyApps”.
This name works for Android applications, but I’ve found that I prefer “MyMain” for my project because it’s easier to remember and it doesn’t conflict with other applications.
Install JSF in your Windows, Linux, or Mac operating system.
JSF is a Java library for creating Web-based applications.
You’ll need JSF on Windows to compile your Android application.
You can also use JSF for other Android applications you may have built on the Windows platform.
Configure Eclipse to build your Java application on the Java virtual machine.
Eclipse can install the JVM, Java Tools, and Eclipse, but if you’re not using the Eclipse IDE or Java Platform Builder, you won’t be able to configure the Jvm and the Tools to your liking.
If your app uses Java and you’re installing the Eclipse platform, the JNI configuration settings will be ignored.
You will need to configure Eclipse to use JNI.
Install your Android development tools.
Eclipse provides the Eclipse JMX SDK, which lets you connect to the JMX server on your Java devices and create a Java application.
This will allow you to build and deploy your application using Eclipse.
Eclipse also offers Eclipse Development Tools, which let you create a Web application and test it using the Java Testing Platform.
These tools are optional, but are great for debugging.
10: Create your Eclipse Java app.