Android SDK and Eclipse ADT on Fedora 16/15, CentOS/RHEL 6
Table of Contents
This is guide howto install Android SDK Tools r16 and Eclipse ADT (Android Development Tools) Plugin on Fedora 16, Fedora 15, Fedora 14, Fedora 13, CentOS 6.2/6.1/6 and Red Hat (RHEL) 6.2/6.1/6.
This Guide Contents⌗
- 1. Preparing Your Development Computer and Install Required softwares
- 2. Install Andoid SDK
- 3. Install ADT Plugin for Eclipse
- 4. Configure Eclipse and Install Latest Android SDK with AVD Manager
- 5. Create Simple Android Test Project
1. Preparing Your Development Computer and Install Required softwares⌗
1.1 Install Sun/Oracle Java 7 JDK/JRE⌗
1.2 Install Eclipse SDK 3.7 (Indigo)## 2. Install Andoid SDK⌗
2.1 Change root user⌗
su -
## OR ##
sudo -i
2.2 Download and Install Android SDK⌗
## Select place to download
cd /tmp
## Download Android SDK r16 package for Fedora, Red Hat (RHEL) ##
wget http://dl.google.com/android/android-sdk_r16-linux.tgz
Note: Latest SDK r16 (Android 2.3 Gingerbread and 3.x Honeycomb) emulator is currently working only with Glibc 2.7 or greater, so that’s why CentOS 5.7 and Red Hat (RHEL) 5.7 needs a newer version of Glibc to run Android SDK tools. This is possible to get working with manually build GNU C Library (glibc) 2.7 or later on CentOS 5.7 or Red Hat (RHEL) 5.7, but this might cause much problems and that’s why here is not now guidance for that.
Errors on CentOS 5.7 and Red Hat (RHEL) 5.7 looks following:
/opt/android-sdk/tools/emulator: /lib/libc.so.6: version `GLIBC_2.8′ not found (required by /opt/android-sdk/tools/emulator)
/opt/android-sdk/tools/emulator: /lib/libc.so.6: version `GLIBC_2.7′ not found (required by /opt/android-sdk/tools/emulator)
/opt/android-sdk/tools/emulator: /lib/libc.so.6: version `GLIBC_2.11′ not found (required by /opt/android-sdk/tools/emulator)
2.2 Extract Android SDK⌗
## Extract Android SDK r16 ##
tar -xvzf android-sdk_r16-linux_x86.tgz
2.3 Move Android SDK to right location⌗
## Move Android SDK example to /opt
mv android-sdk-linux_x86/ /opt/android-sdk
2.3 Add Write Permissions to /opt/android-sdk⌗
## Following add write permissions for all users
chmod -R a+w /opt/android-sdk
## On multi-user environment, better way is add permissions only for selected users or group
2.4 Add Android SDK into PATH environment variable⌗
Add following lines to /etc/profile or $HOME/.bash_profile
PATH=$PATH:/opt/android-sdk:/opt/android-sdk/tools:/opt/android-sdk/platform-tools
export PATH
2.5 64-bit Systems needs following 32-bit system packages⌗
yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686
3. Install ADT Plugin for Eclipse⌗
3.1 Open Install New Software window (Help -> Install New Software…)⌗
3.2 Add ADT Plugin repository⌗
Name: ADT
Location: https://dl-ssl.google.com/android/eclipse/
3.3 Select Android DDMS and Android Development Tools⌗
Note If you get something like following error:⌗
The operation cannot be completed. See the details.
Cannot complete the install because one or more required items could not be found.
Software being installed: Android Development Tools 0.9.7.v201005071157-36220 (com.android.ide.eclipse.adt.feature.group 0.9.7.v201005071157-36220)
Missing requirement: Android Development Tools 0.9.7.v201005071157-36220 (com.android.ide.eclipse.adt.feature.group 0.9.7.v201005071157-36220) requires ‘org.eclipse.gef 0.0.0’ but it could not be found
Then simply add Eclipse Indigo repository:⌗
Name: Indigo
Location: http://download.eclipse.org/releases/indigo
And try Install Android Development Tools again.⌗
3.3 Accept ADT Licenses⌗
3.4 Install ADT and restart Eclipse⌗
4. Configure Eclipse and Manage Android SDKs and Virtual Devices (AVD)⌗
4.1 Add Android SDK path to Eclipse settings⌗
Open menu Window -> Preferences
4.2 Start Android SDK and AVD Manager from Menu⌗
4.3 Install All Needed SDKs⌗
4.4 Add needed AVDs Android Virtual Devices⌗
4.5 Test Android Virtual Device⌗
Select Device and click Start…
Starting device (this may take long time)
5. Create Simple Android Test Project⌗
5.1 Create New Android Application⌗
Click File -> New -> Project…
Select Android Project
Add project information⌗
5.2 Add source code for testing Android⌗
Add and save following source code⌗
package com.ifnottruethenfalse;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class IfNotTrueThenFalse extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv = new TextView(this);
tv.setText("This is simple test application!\nwww.if-not-true-then-false.com");
setContentView(tv);
}
}
5.3 Run Android application⌗
Click Run -> Run as -> Android Application