So you finally ran AndroVM. Now you want to use it to replace the clunky and resource hogging Android emulator with your Eclipse GUI.

To do so, make sure you know the IP address of your Android virtual machine. The default is 192.168.56.101. But if you want to change the default IP address, here is where you can find it.

  • In Oracle VM VirtualBox, go to File > Preferences > Network
  • Click on the label on the right that says Virtual Host-Only Ethernet Adapter
  • Click the 3rd icon that looks like a screw driver
  • Under the DHCP server tab, look at the Lower Address Bound

That is the IP address of the virtual machine. See photo below for a screenshot.

virtualbox_androvm

Now, once you have the virtual machine up and running, to link it to Eclipse so that it will use that as your test environment when running your apps, open MS-DOS prompt.

Go to where your Android sdk is installed. I installed mine in c:\program files\Android\android-sdk\platform-tools

Then type adb connect 192.168.56.101.

You will know if connection was successful by typing adb devices. Your IP address should be there.

Now in Eclipse, when you deploy your app, do the following:

  • Right click on the project name, choose Run As > Run Configurations
  • Go to Target tab and select Always prompt to pick device.
  • Click Apply button

Once you deploy your Android app, a popup window will show first giving you a list of Android related devices running (your virtual machine included).

I will get right to the point. There is no accurate way using Javascript to detect if  a Java Virtual Machine exists in the client’s machine. While existing Javascript functions may work in some browsers, it does not in some. Luckily, after Oracle bought Java, they made a small Javascript code that can do just that.

Search Google with the keyword deployJava.js and you will find a search result with the label Java™ Rich Internet Applications Deployment Advice.

The page includes short descriptions on available functions to use and code snippets on how to incorporate the Javascript code with yours. Using it is pretty easy. Just import the Javsacript file deployJava.js

You can do a simple version check if a Java Virtual Machine exists in the client’s machine with version 1.6.

This code typically redirects the user viewing the page to the Java JVM installation site in case no JVM is detected. Pretty easy right?

Related Posts Plugin for WordPress, Blogger...