Sunday, February 28, 2016

3. Android Development Tools
3.1. What are the Android Development Tools?
Google provides the Android Development Tools (ADT) to develop Android applications with Eclipse. ADT is a set of components (plug-ins) which extend the Eclipse IDE with Android development capabilities.
ADT contains all required functionalities to create, compile, debug and deploy Android applications from the Eclipse IDE and from the command line. Other IDE's, e.g. IntellJ, are also reusing components of ADT.
ADT also provides an Android device emulator, so that Android applications can be tested without a real Android phone.
3.2. Dalvik Virtual Machine
The Android system uses a special virtual machine, i.e. the Dalvik Virtual Machine to run Java based applications. Dalvik uses an own bytecode format which is different from Java bytecode.
Therefore you cannot directly run Java class files on Android, they need to get converted in the Dalvik bytecode format.
3.3. How to develop Android Applications
Android applications are primarily written in the Java programming language. The Java source files are converted to Java class files by the Java compiler.
Android provides a tool called "dx"" which converts Java class files into a dex (Dalvik Executable) file. All class files of one application are placed in one compressed .dex file. During this conversion process redundant information in the class files are optimized in the .dex file. For example if the same String is found in different class files, the .dex file contains only once reference of this String.
These dex files are therefore much smaller in size than the corresponding class files.
The .dex file and the resources of an Android project, e.g. the images and XML files, are packed into an .apk (Android Package) file. The program aapt (Android Asset Packaging Tool) performs this packaging.
The resulting .apk file contains all necessary data to run the Android application and can be deployed to an Android device via the "adb" tool.
The Android Development Tools (ADT) allows that all these steps are performed transparently to the user; either within Eclipse or via the command line.
If you use the ADT tooling you press a button or run a script and the whole Android application (.apk file) will be created and deployed.


No comments:

Post a Comment