Android Application Development Environment
- Android requires following tools to be installed in the order mentioned below to create the development environment:
- Java SDK
- Android SDK
- Eclipse IDE
- Android Development plugin for Eclipse
Android Project Structure
- Key items in the project's root directory :
- AndroidManifest.xml : an XML file describing the application activities, services, etc.
- bin/, application after it is compiled
- src/, Java source code
- res/, holds "resources", such as icons, GUI layouts etc
- Gen/, system generated java code
Android SDK Tools
- The Android SDK includes a variety of custom tools that help you develop mobile applications on the Android platform.
- All the tools of the android are located in tools/ directory of the SDK.
- Emulator: Virtual Mobile device that runs on computer
- Dalvik Debug Monitor Service (ddms): Provides screen capture on the device, thread and heap information on the device, logcat,process, and radio state information, incoming call and SMS spoofing, location data spoofing, and more.
- Android Debug Bridge (adb): a versatile tool lets us manage the state of an emulator instance or Android-powered device.
- Android Development Tools Plugin: a plugin for the Eclipse IDE that lets us quickly set up new android projects
- Android Virtual Devices (AVDs): Configurations of emulator options that lets us better model an actual device
- Android Asset Packaging Tool (aapt): allows us to view, create and update Zip-compatible archives (zip, jar, apk) and to compile resources into binary assets.
- Traceview: A graphical viewer for execution logs saved by the application and it helps in debugging
- Hierarchy viewer: Provides a visual representation of the Layout view and allows us to debug and optimize UI
- Mksdcard: Lets us create a FAT32 disk image that can be loaded in the emulator to simulate an SD card
- Dx: Lets us generate android byte code from .class files.
- UI/Application Exerciser Monkey: Program that runs on emulator/device and generates stream of user events(clicks, touches,gestures) and number of system level events. It is used to stress-test applications.
- Layoutopt: Helps us to optimize the layouts and layout hierarchies.
- Draw 9-patch: Allows us to create a NinePatch graphic using a WYSIWYG editor
- Android Interface Description Language (aidl) : Used to generate code that enables two processes on android powered device to talk using IPC
- Sqlite3: Command-line program to manage SQLite databases created by android applications
- android tool available in the tools/ directory of the sdk when invoked with no options will launch the interface shown below to manage the AVDs.
- Android tool provides command line options to perform all the operations supported the following interface.
- By default, the android tool creates the AVD directory in following path
- Linux & Mac : ~/.android/avd/
- Windows : C:\Documents and Settings\<user>\.android
Android Virtual Devices are configurations of emulator that allows the users to model a actual device. Each AVD allows the user to set
- Hardware profile: Used to define the hardware features of the virtual device.
For example:Availability of camera in device
Memory capacity on the device etc
2. Android platform
3. Emulator skin
4. Emulated SD card
5. Dedicated storage area on development machine, which is used to store the device's user data (installed applications, settings, and so on) and emulated SD card.
Starting the Emulator:
Starting the emulator
- Command line
Through emulator it will be invoked automatically, when the application is started.
- Emulator startup options
Dalvik Debug Monitor Server (DDMS) is a debugging tool, which provides following functionalities:
- Port-forwarding services
- Screen capture
- Thread and heap information
- Process and Radio state information
- Incoming call and SMS spoofing
- Location data spoofing