Programming Android Apps: SDK and Eclipse (ubuntu)

Android is a brilliant smart phone operating system, this is the start of a short series of guides for starting to program applications for it using the android SDK.

Android SDK
Download the android SDK

Once downloaded untar the SDK

tar xvzf android-sdk_r04-linux_86.tgz

The SDK is not complete as additional files need to be downloaded in order to compile for different versions of android. Open the SDK and AVG management application by moving into the SDK folder and running the following.

sh tools/android

In the avaliable packages select the android versions you wish to develop for, and begin downloading them. Should this fail please read the next section, otherwise skip ahead.

Failing to download
If you cannot download from the google website, goto settings and select “force https://… source to be fetched using https://” and click save and apply.

android force http

forcing SDK and AVD manager http instead of https for android

If this still does not work (as was the case for me) it is possible that for some reason a configuration file was not created for this program, this can be solved by creating it manually:

echo sdkman.force.http=true > ~/.android/androidtool.cfg

Creating Android Virtual Devices
You can create virtual android phones using the SDK and AVD manager, click the Virtual Device tab and select new. Enter a name for the device, and a size for the sd card and simply click create AVD.

android create avd

creation of an android virtual device

Once you’ve created you Virtual Device(s) it should look like the following:

android avd's

Android Virtual Devices

You can test these virtual devices and see how nicely the phones are emulated. This is much more useful once you begin writing applications.

Android virtual device

Android Virtual Device in action


I would highly recommend using eclipse as it, along with the android plugin, greatly simplifies production and testing of applications.

Download eclipse from the ubuntu repositories (or from the eclipse website)

sudo apt-get install eclipse

If you do not already have java installed then you will need to install it.

sudo apt-get install sun-java6-jdk sun-java6-jre

You will need to add the following line to your .bashrc in your home folder so that the android tools can be used in eclipse (and other programs).

export PATH=${PATH}:/home/user/android/sdk/tools

* replace /home/user/android/sdk with the path to where you downloaded the SDK

Installing the android plugin for eclipse
Google’s eclipse plugin install guide.

In eclipse goto help then Install new software and then add the google plugin url

Install software

Install new software in eclipse

Then install Android DDMS and Android Development Tools.

Should you receive errors (like I did) relating to a missing package you will need to add the eclipse repository and install the missing packages.

You should then have a fully working eclipse with android plugin.

Eclipse main window

Eclipse main window

What next?
Now you should have everything setup in order to develop and android applications. I would recommend the google tutorials:

Read More

Installing custom roms and backing up the T-mobile Pulse (Huawei)

The chaps over at the modaco forums have detailed how to backup and replace the firmware on the android T-mobile pulse. This post aims to consolidate and link all the information in these posts and provide a few explanations.

tmobile pulse

tmobile pulse

Rom – a file which contains the image for a particular version of android
Nand memory – the internal memory of the phone which contains android
flashing – replacing the contents of the Nand memory
root – superuser or admin

Gaining root access
This follows the forum post here

  • Download superboot and unzip.
  • Reboot your phone into bootloader mode (Power off your phone then turn it on with volume down and the red button pressed). You should be presented with a blue screen and some information, connect your pulse to your computer via the usb cable.
  • Windows – Run ‘install-superboot-windows.bat’
  • Mac – Run ‘./’, You may need to make the script executable by using ‘chmod +x’
  • Linux – Same as above ‘./’ and ‘chmod +x’. These commands will most likely need root access so you may need to prepend these commands with ‘sudo ‘.
  • You should now see your pulse has some text on the screen with information about how much data was transfered.
  • Reboot (by taking the battery out) and you should now have root access on your phone

Installing and running recovery tool
This follows the forum post here.

  • The process is the same as above but using a different zip file: recovery
  • Once rebooted, you will need to install the ‘quickboot’ program from the market app. This will allow you to boot into recovery mode (this require root access which we have previously attained)
  • Using the recovery tool you can backup your android using Nandroid, this will only save the Nand memory not any of your settings.
  • The backup will by default save the backup to your SD card, you can then enable usb transfer in the recovery menu and save this to your computer.

Partitioning your SD card
The SD card may need to be partitioned in preparation for the custom rom.

  • From the recovery menu you can partition your SD card.
  • By default the size of the swap partition (used as “extra”-RAM by android) is 32mb however the current MoDaCo Custom ROM’s will not boot properly if there is a swap drive on the SD card
  • The MoDaCo roms also allow an ext2 partition to be made for applications in order to free internal memory.

Installing Custom Roms
Now the SD card is partitioned we can go about installing the new version of android to our pulse. We simply upload the rom zip onto the SD card and select the update option from the recovery mode. The first boot after this is done will take a while to transfer all the apps to your SD card.

Currently there are two roms from MoDaCo, one Customised Vanilla android 1.5 and a Customised T-mobile 1.5. They contain useful extra tools and include ssh access (with the password for ssh contained in the about screen).

Hopefully there will soon be a rom will be release with a updated version of android 1.6 or 2.0 which can be flashed onto the pulse to bring all the new and improve features described here. Recent discussions have hinted at multi-touch becoming a reality once the kernel sources are released (they are now released)

Read More