This section describes on setting up the environment for development and installation of android.Before installing Android Development Tool (ADT) we must installed the compatible versions of both Eclipse IDE and the Android SDK. For checking the compatibility of Eclipse we need to check the following system requirements.
Supported Operating Systems:-
- Windows XP (32-bit), Vista (32- or 64-bit), or Windows 7 (32- or 64-bit)
- Mac OS X 10.5.8 or later (x86 only)
- Linux (tested on Ubuntu Linux, Lucid Lynx)
- GNU C Library (glibc) 2.7 or later is required.
- On Ubuntu Linux, version 8.04 or later is required.
- 64-bit distributions must be capable of running 32-bit applications
For Ubuntu you can do this through the following command.
Syntax: – apt-get installs ia32-libs
Supported Development Environments:-
- Eclipse 3.6.2 (Helios) or greater
- Eclipse JDT plug-in (included in most Eclipse IDE packages)
- There are so many Eclipse packages are available for each platform. In the developing purpose we install any one the following packages 3.1) Eclipse IDE for Java Developers 3.2) Eclipse Classic 3.3) Eclipse IDE for Java EE Developers
- JDK 6 (JRE alone is not sufficient)
- Android Development Tools plug-in (recommended)
- Not compatible with Gnu Compiler for Java (gcj)
- Apache Ant 1.8 or later
Install ADT Plug-ins and Android SDK
Here we are using Update Manager of our Eclipse installation to install y\the latest version of ADT.
1) Start Eclipse, then select Help > Install New Software….
2) Click Add, in the top-right corner.
3) In the Add Repository dialog that appears, enter “ADT Plug-in” for the Name and the following URL for the Location:
Syntax: – https://dl-ssl.google.com/android/eclipse/
4) Click OK
Note: If you have trouble acquiring the plug-in, try using “http” in the Location URL, instead of “https” (https is preferred for security reasons).
5) In the Available Software dialog, select the checkbox next to Developer Tools and click Next.
6) In the next window, you’ll see a list of the tools to be downloaded. Click Next.
7) Read and accept the license agreements, then click Finish.
Note: If you get a security warning saying that the authenticity or validity of the software can’t be established, click OK.
8) When the installation completes, restart Eclipse.
It will ask whether you want to send usage statistics to Google, select Yes.
Configuring the ADT Plug-in (Manual installation of the Android SDK):-
After you’ve successfully downloaded the ADT as described above, the next step is to modify your ADT preferences in Eclipse to point to the Android SDK directory:
1) Select Window > Preferences… to open the Preferences panel (Mac OS X: Eclipse > Preferences).
2) Select Android from the left panel.
You may see a dialog asking whether you want to send usage statistics to Google. If so, make your choice and click Proceed. You cannot continue with this procedure until you click Proceed.
3) For the SDK Location in the main panel, click Browse… and locate your downloaded SDK directory.
4) Click Apply, and then OK.
Install a specific Android version:
The Android SDK Manager permits us to install specific versions of Android. Select Window → Android SDK Manager from the Eclipse menu.
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”.
Press the “Install” button and confirm the license for all packages. After the installation completes, restart Eclipse.
Android virtual device – Emulator
An android emulator helps to run an android system. The android development tool (ADT) helps to include an emulator for running this running purpose. The android emulator act as a real android device and it permits to test our application without having a real device. We can start several android virtual devices in parallel. The file system of the new AVD needs to get prepared so the starting of a new emulator is very slow.
At the time of creation of an android virtual device we decide which one we want to create. That is we decide it is fully Android device or Google device. If an android virtual device (AVD) created for android it will consists of the programs from the android Open Source Project. An AVD created for the Google API’s it will consists of several Google applications or Google Maps application.
Eg: – Cloud2DeviceMessaging or Google Maps you must run this application on an AVD with Google API’s.
An android virtual machine contains the following elements.
1) A hardware profile: This element specifies the hardware features of the virtual device.
Eg:-We can specify whether the device has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how much memory it has, and so on.
2) A mapping to a system image: we can also specify the version of the Android platform will run on the virtual device and choose a version of the standard Android platform or the system image packaged with an SDK add-on.
3) Other options: We can specify the emulator skin you want to use with the AVD, which lets you control the screen dimensions, appearance, and so on. You can also specify the emulated SD card to use with the AVD.
4) A dedicated storage area on your development machine: The device’s user data (installed applications, settings, and so on) and emulated SD card are stored in this area.
Android Emulator Shortcuts
The android emulator uses the following shortcuts. They are
1) Alt+Enter: – It maximizes the emulator.
2) Ctrl+F11:- It changes the orientation of the emulator.
3) F8 :-Turns network on / off
4) HOME:- HOME
5) F2 or Page-up button:- Menu (left softkey)
6) Shift-F2 or Page Down:- Star (right softkey)
7) ESC:- Back
8) F3:- Call/dial button
9) F4:- Hangup/end call button
10) F5:- Search
11) F7:- Power button
12) KEYPAD_PLUS, Ctrl-F5:- Audio volume up button
13) KEYPAD_MINUS, Ctrl-F6:- Audio volume down button
14) Ctrl-KEYPAD_5, Ctrl-F3:- Camera button
15) KEYPAD_9, Ctrl-F12:- Switch to next layout orientation (for example, portrait, landscape)
16) F9 (only with -trace startup option):- Toggle code profiling
17) F6:- Toggle trackball mode
18) Delete:- Enter trackball mode temporarily (while key is pressed)
19) KEYPAD_4/8/6/2:- DPad left/up/right/down
20) KEYPAD_5:- DPad center click
21) KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/):-Onion alpha increase/decrease
How to create and run android virtual emulator
For the determination of an AVD we open the “AVD Manager” through Windows→ AVD Manager and press “New”.
After that we are entering the following details.
We can select the box “Enabled” for Snapshots and this will make the second start of the virtual device much faster. After pressing the “Create AVD” will helps to create AVD configuration and display it under the “Virtual devices”. For the checking of our setup status we select our device and press “Start”. After a long time our AVD starts and we can use it through the mouse and the virtual keyboard of the emulator.
The graphics of the emulator are providing in software which is very slow. By solving this problem we are using a small resolution for our emulator.
Eg: – HVGA
We have a sufficient memory on our computer we add at least 1 GB of memory to our emulator and this is the value “Device ram size” during the creation of the AVD. Also we can set the flag “Enabled” for snapshots and this will helps to save the state of the emulator and also helps to start much faster.
2) Hardware button
We can create hardware buttons for an android system. For achieving this property we are adding “Hardware Back/Home keys” property to the device configuration and set it to “false”.