Developing in Linux is something a little bit more obscure than working on Windows or Mac. Usually things on Windows or Mac are really straight forward, just download some kind of GUI and then press Next until you get the Finish button. In Linux you will have to deal with the terminal and editing files, which may seem hard or confusing at first but you will notice that it also gives you access to a lot more customization options. I will assume you already know how to move in the terminal or in the Desktop Environment, compress/uncompress, copy, move and delete files and you already have a JDK compatible with the specifications here: http://developer.android.com/sdk/requirements.html.
All the information here is the combination of the official Android documentation and my own personal experience.
http://developer.android.com/sdk/installing.html
The SDK
The main element to start with Android Development is to get the SDK, which can be found at:
http://developer.android.com/sdk/index.html
Here you will download android-sdk_rXX-linux.tgz, where XX represents the revision number.
The IDE
The IDE of choice for Android Development is Eclipse. The most recent version of Eclipse as of this post is Eclipse Indigo, which I have some troubles getting it to work with the Android SDK, so my recommendation is to stick with Eclipse Helios SR2, anyways its not like a lot have changed between versions. Eclipse Helios SR2 can be found here:
http://www.eclipse.org/downloads/packages/release/helios/sr2
If you want to test the newest edition of Eclipse it can be found here:
http://www.eclipse.org/downloads/
Remember to get the classic, java or javaee version of Eclipse.
Setting the Environment
This is based on my personal experience should work exactly the same in any other system.
Now go to the terminal and lets go the the location where the files where downloaded.
Now uncompress the files with the `tar -xf` command. Example:
tar -xf eclipse-java-indigo-SR1-linux-gtk-x86_64.tar.gz
tar -xf android-sdk_r15-linux.tgz
Is also really handy to add the location of you sdk to your path, this can be done this way:
Edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ and platform-tools/ directories to it. If you don’t see a line setting the path, you can add one:
-
export PATH=${PATH}:<sdk>/tools:<sdk>/platform-tools
Now lets move the folders to a location we can access them easily. We are going to make eclipse executable and then move eclipse/ to /usr/local/lib/ and create a link to the binary file in /usr/loca/bin/, for this we are going to do:
chmod +x ./eclipse/eclipse
sudo mv ./eclipse /usr/loca/lib
sudo ln /usr/local/lib/eclipse/eclipse /usr/local/bin/eclipse
Now lets move the folder android-sdk to the home directory and make it not visible:
mv ./android-sdk ~/.android-sdk
Note:
If you are developing on a 64-bit machiine you may need some 32bit libs so you can execute this files. Assuming you are in ubuntu, just run this command:
sudo apt-get install ia32-libs
In more recent versions of Ubuntu this libs are already included.
The Plugin
This part is really straight forward and is also cross-plataform so you can follow the instructions in here http://developer.android.com/sdk/eclipse-adt.html.
Now you will be able to access the Android SDK from Eclipse, the next step is going to be to download the components of the SDK, this part will take a long time. This is also straight forward and cross-plataform, instuctions here: http://developer.android.com/sdk/adding-components.html.
Up to this point you should have the Eclipse set-up, the SDK with the different components you want and an Emulator. Soon I will post some examples for people to start with ther first apps, until then you can start reading here: http://developer.android.com/resources/browser.html?tag=tutorial.
