Wednesday, May 16, 2012

5. Installation

5.1. Eclipse

The following assumes that you have already Java and Eclipse installed and know how to use Eclipse. For an introduction into Eclipse please see the following tutorial: Eclipse IDE Tutorial.
The tutorial above also describes how to install new components into Eclipse. This is required to install the Android Development Tools. You find the necessary steps described in the following section of the tutorial: Eclipse Update Manager.
The author of this text has also published a Kindle book on the usage of the Eclipse IDE, which can be found here: Eclipse IDE Book for Kindle.

5.2. Pre-requisites for using a 64bit Linux

The Android SDK is 32bit, therefore on a 64bit Linux system you need to have the package ia32-libs installed. For Ubuntu you can do this via the following command.
    
apt-get install ia32-libs
   
Please check your distribution documentation, if you are using a different flavor of Linux.

5.3. Install ADT Plug-ins and Android SDK

Use the Eclipse update manager to install all available components for the Android Development Tools (ADT) from the URL https://dl-ssl.google.com/android/eclipse/.
After the new Android development components are installed, you will be prompted to install the Android SDK. You can use the following wizard or go to the next section to learn how to do it manually.
Wizard to install Android SDK - Part 1
Wizard to install Android SDK - Part 2
Wizard to install Android SDK - Part 3

5.4. Manual installation of the Android SDK

After the installation of the ADT the Eclipse tooling allows to download the Android SDK automatically. Alternatively you can also manually download the Android SDK from the Android SDK download page.
The download contains a zip file, which you can extract to any place in your file system, e.g. on my Linux system I placed it under "/home/vogella/android-sdks". Avoid using spaces in the path name, otherwise you may experience problems with the usage of the Android SDK.
You also have to define the location of the Android SDK in the Eclipse Preferences. In Eclipse open the Preferences dialog via the menu WindowsPreferences. Select Android and enter the installation path of the Android SDK.
Setting up the Android SDK in the Eclipse Preferences

5.5. Install a specific Android version

The Android SDK Manager allows you to install specific versions of Android. Select WindowAndroid SDK Manager from the Eclipse menu.
Starting ADV Manager
The dialog allows you to install new packages and also allows you to delete them.
Select "Available packages" and open the "Third Party Add-ons". Select the Google API 15 (Android 4.0.3) version of the SDK and press "Install".
Install Android API
Press the "Install" button and confirm the license for all packages. After the installation completes, restart Eclipse.

5.6. Android Source Code

The following step is optional.

5.6.1. As of Android 4.0

During Android development it is very useful to have the Android source code available.
As of Android 4.0 the Android development tools provides also the source code. You can download it via the Android SDK Manager by selecting the "Sources for Android SDK".
The sources are downloaded to the source directory located in "path_to_android_sdk/sources/android-xx". xx is the API level of Android, e.g. 15 for the Android 4.0.3 version.
To connect the sources with the android.jar file in your Android project, right click on your android.jar in the Eclipse Package Explorer and select PropertiesJava Source Attachment. Type in the source directory name and press OK.
Afterwards you can browse through the source code.

5.6.2. Prior to Android 4.0

For earlier versions Haris Peco maintains plugins, which provide the Android Source code code. Use the Eclipse update manager to install the Android Source plugin from the following update site: "http://adt-addons.googlecode.com/svn/trunk/source/com.android.ide.eclipse.source.update".
More details can be found on the project website.

No comments:

Post a Comment