Part 2: Install Android SDK

Installing the Android SDK required by PhoneGap/Cordova to compile your web application to an Android application:

On Linux (checked on Ubuntu) install the JRE:

  • Check if your system is 32 or 64 bit by uname -a
    A response of
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
    means 32-bit and
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
    means 64-bit

  • If your system is a 32-bit OS then sudo apt-get install libgl1-mesa-dev else sudo apt-get install ia32-libs

  • Install Java JRE: sudo apt-get install openjdk-7-jdk

Next, Download the Android Developer Tools (ADT) (here) for your platform and unzip them to the folder of your choice (for example /my-ADT-path)

On Linux:
vim ~/.bashrc

vim ~/.profile
vim ~/.bash_profile

and add:

export PATH=$PATH:/my-ADT-path/tools
export PATH=$PATH:/my-ADT-path/platform-tools

I’ll skip the path explanation for Windows

To build with Cordova for the Android platform, you’ll also need to install ant:

sudo apt-get install ant

brew install ant

You’ll also need to install some (preferably recent) version of the Android API after installing the SDK. You can do this by typing

$ android

This will bring up the Android SDK manager from which you can install an Android API version of your choice

Leave a Reply

Your email address will not be published. Required fields are marked *