Wednesday, December 28, 2011

Installation Eclipse and automatic Android SDK

3. Installation

The following assume that you have already Eclipse installed. For details please see Eclipse Tutorial .

3.1. Eclipse and automatic 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/. If you are not familiar with the Eclipse update manager the usage is described in Eclipse update manager.

After the new Android development components are installed you will be prompted to install the Android SDK. You can do follow 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

3.2. Manually install Android SDK

The previous step downloads the Android SDK automatically for you. You can also download the Android SDK manuallz from the Android homepage under Android SDK download. The download contains a zip file which you can extract to any place in your file system, e.g. I placed it under "c:\android-sdk-windows". Avoid using spaces in the path name otherwise you may experience problems later.

You also have to define the location of the Android SDK in the Eclipse Preferences. In Eclipse open the Preferences dialog via WindowsPreferences. Select Android and enter the installation path of the Android SDK.

Setting up the Android SDK in the Eclipse Preferences

3.3. 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 package and also allow you to delete them. Select "Available packages" and open the "Third Party Add-ons". Select the Google API 14 (Android 4.0) version of the SDK and press "Install".

Install Android API

Press the "Install" button and confirm the license for all package. After the installation restart Eclipse.

3.4. Android Source Code

The following step is optional.

During Android development it is very useful to have the Android source code available as Android uses a lot of defaults.

Haris Peco maintains plugins which provides access to 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.

4. Using the Emulator

4.1. Create an Android Emulator Device

The Android tools include an emulator. This emulator behaves like a real Android device in most cases and allows you to test your application without having a real device. You can emulate one or several devices with different configurations. Each configuration is defined via an "Android Virtual Device" (AVD).

To define an AVD open the "AVD Manager" via WindowsAVD Manager and press "New".

Create a new AVD

Enter the following.

Settings for a new AVD

We can also select the box "Enabled" for Snapshots. This will make the second start of the virtual device much faster.

At the end press the button "Create AVD".This will create the device and display it under the "Virtual devices". To test if your setup is correct, select your device and press "Start".

After (a long time) your device should be started.

4.2. Emulator Shortcuts

Obviously you can use the emulator via the keyboard on the right side of the emulator. But there are also some nice shortcuts which are useful.

Alt+Enter maximizes the emulator. Nice for demos.

Ctrl+F11 changes the orientation of the emulator.

F8 turns network on / off.

4.3. Performance

Try to use a smaller resolution for your emulator as for example HVGA. The emulator gets slower the more pixels its needs to render as it is using software rendering.

Also if you have sufficient memory on your computer, add at least 1 GB of memory to your emulator. This is the value "Device ram size" during the creation of the AVD.

Also set the flag "Enabled" for Snapshots. This will save the state of the emulator and let it start much faster.

No comments:

Post a Comment

My Headlines

RF Optimization 2G,3G,4G and Wimax

Subscribe Now: google

Add to Google Reader or Homepage