Wednesday 21 August 2013

Developing Android apps

I thought I would have a quick run through some of the tutorial info on getting a basic Android application built and then run it on the Android x86 port I have running in a VM.

I downloaded the adt bundle for linux which includes the sdk, a version of eclipse and the adt plugin. First time through I forgot that I did not have a jdk environment installed so had to grab that as well.
I also added the platform-tools and tools directories to my PATH.

Following the instructions I tested out a basic layout on the emulator that comes as part of the bundle and then exported my project as an Android application.

Here is where I believed the tricky part would be, to get the apk file onto my android instance running in a VM. I could have placed it on a webserver and then downloaded it (but where is the fun in that). If this was runnign on a real device/handset I could connect it up via usb and use adb.

Actually I can still use adb, as android is running in a VM and has networkig configured I just need to configure adb to connect to the VM.
I do this by the command

adb connect <ip address of VM>:5555

Then I can load my custom application using
adb install <apk file>

When I did this I needed to dismiss a warning that popped up on android, but the application installed fine. 

Once the application has been installed, disconnect adb using
adb disconnect

Both before connecting adb and after it is worth checking that an existing adb server instance is not already running, it can be killed with
adb kill-server

Now to figure out a useful app to develop.