2.3 Android Development Tools

Welcome!! This section is dedicated towards to the tools dedicated for app development. Let us know about the tools we have used or will be using for the purpose of developing android applications in near future.

2.3.1 Analyzing Android Software Development Kit (Android SDK)

There are many flexible packages which can be downloaded separately. Android SDK Manager is used for this task. Let us find out what is in the box of our kit.

  • Platform: For each version of android at least one android platform is available. Platform contains an android.jar file and a manageable android library. For each app platform has to be specified as your build target.
  • Android API: Developers use these libraries to access the Android stack. These are the same libraries that are used by Google to create native applications for android.
  • Tools: It contains tools for debugging and testing of apps. It contains the tools required for developing apps.
  • Platform Tools: We have many platforms of android. This is pointing towards different versions of android platforms. This package contains platform-dependent tools.

From real life, let us consider the example of tea and coffee. Some people prefer to drink coffee and some tea. Choice differs from person to person. Both of these beverages need milk and sugar. But differ in coffee and tea powder. This very difference gives then two different tastes and aroma. Same thing applies here.

    Same tools are required to develop apps, but every platform has its own characteristics. For that platform dependent tools are required. These tools update whenever SDK is updated. They are backward compatible i.e., they support older versions of platform.

      • Complete and Comprehensive Documentation: Android’s reference documentation and developer guide explains how to initiate developing. It gives detailed explanations of the fundamentals behind Android development. Best practices are highlighted. All the framework topics are covered in-depth.

      Full code documentation is included. How to use them and level of detailing is explained for developers. This is offline documentation.

      • System Image: Every platform offers one or more system image. Emulators require system images to run or test our applications. You might be thinking what the heck is this system image and hotchpotch going on. Let us find out what is a system image.

      System image is a copy of entire computer is a nonvolatile form like in a file.You can use a system image to restore the contents of your computer if your hard disk or computer ever stops working. A system is said to be capable of using system images if it can be shut down and later restored to exactly the same state. Two images we will use are ARM and x86.

      ARM stands for Advanced RISC Machines. R.I.S.C? Since I am considering the readers from all spheres so have to say something about this. RISC stands for Reduced Instruction Set Architecture. This is a 32-bit processor.  They require fewer transistors as compared to other machines. This reduces cost, heat and powerful usage. Design was

      x86 is family of backward compatibleinstruction set architectures

      ARM CPUs are designed to consume low power right from beginning but Intel decided to use x86 based Atom line CPU for netbooks which even lowers power usage.

      • Source code; Source code of platform is copied so that debugging of app can be easier. In short, Sources for android SDKs are provided.
      • Samples: Chunks of samples are provided for different platforms. These demonstrate different APIs of different platforms. 
      • Android Support: This is a static library. It can be included in apps to use significant APIs which are unavailable to standard platforms.
      • Google APIs: This is an add-on to SDK. It helps in developing apps that uses special Google APIs.
      • Google Play: Both licensing and billing services are supported. These are static libraries which allow us to integrate billing services and licensing services respectively. Samples are provided for both purposes. 
      • The Android Virtual Device Manager and emulator: An Android Virtual Device (AVD) is an emulator configuration which emulates the hardware and software profile of device which is to be emulated by emulator. An AVD configuration consists of following ingredients:
      1. Hardware Profile: Hardware features of virtual device. You can set camera, size of memory, etc.
      2. System image: A mapping to system image on which the virtual device is to run.
      3. Emulator skin: Skin of emulator can be detailed which will be used with AVD. Screen resolution, size of SD card, etc can be managed.
      4. Storage area: User data like settings etc and emulated SD card are stored in this devoted area of development machine.

      An emulator is an application that supports a virtual device which prototypes, develops and tests the applications without using a real device. It is a parrot. It mimics all hardware and software features of device. It cannot make a real phone call. It runs a full Android system stack, down to the kernel level. It includes a set of preinstalled applications (such as the dialer, messenger) which can be accessed from our applications.

      Each AVD is an independent device. It has its own storage and data.  In each configuration, an Android platform is specified which is to be run in the emulator along with the set of hardware options, emulator   skin, etc. when emulator is launched, we specify the AVD configuration that we want to load. As soon as we launch the emulator with an AVD configuration, it automatically loads the user data and SD card data from the AVD directory. By default, cache, user data and SD card is stored in AVD directory.AVD manager manages all the emulators.

      Android virtual device manager

      Figure Relation between AVD Manager, AVD and Emulator

      • Online help: There are active developer communities which always resolve the queries and problems of developers.

      2.2.2 Eclipse

      Let us know few things about eclipse also.

      Eclipse is an Integrated Development Environment (IDE). It has a basic workspace and a plug-in system which can be extended for customizing the environment. It is mostly written in java. And java applications are developed with this. However with plug-ins eclipse can be used to develop applications for other programming languages like C, C++, PHP, etc. It is released under Eclipse Public License. It is free and open source software. It is incompatible with GNU General Public License.

      From point of view of android we have the plug-in named ADT. Eclipse and ADT plugin provides GUIs and wizards to create android projects. There are three types of projects:

      1. Android Application Project: This contains all the resources and files which are required to create an application which can be installed on a device.
      2. Library Project: This type of project can be shared among other projects which depend on it. It cannot be installed on a device. 
      3. Test Project: These projects include JUnit functionality which contains android specific features. 

      Android porjects stucture

      By default, build process continuously runs in background which is hidden from user. Eclipse and ADT hides the detailing from user. It automatically enables debugging and sign apps with a debug key. Eclipse initiates a ADB. App is then installed on to emulator or device. Nothing is manual. Just like Maggie, you put the spices and it is ready to eat in 2 minutes. Ready to cook. Eclipse and ADT make the development environment ready to develop. Let us keep the things simple and remember the following points. There is no external viva for this. This is for your knowledge. We should know little bit about ingredients to not to confuse ourselves with different technical jargons.

      • Eclipse Java editor is a text editor for Java. Eclipse gives warning when the code is cannot be parsed by the compiler. It also helps while you are coding. It provides suggestions as well. Intelligent, isn’t it!!
      • XML editors for android XML resources.
      • Static analysis tools which keeps an eye on performance
      • There are quick fixes.
      • Integrated navigation between java and xml resources.
      • Eclipse debugger is used for debugging the programs.

      2.2.3 Debugging

      Apart from eclipse debugger, we have other helpful ailments. Let us have a glance on them also. They are essential components in app debugging.

      • Both java compiler and Dalvik translator provides error information if they cannot build the application.
      • Android provides a logging package called LogCat. It is general-purpose package from which developer can find out log information or error messages when app is running. It tells us what is going on as it starts up, initiates our application, and tries to run it.
      • Android Debug Bridge provides an interface to running device or emulator. It is used as command line debugging interface.
      •  DDMS (Dalvik Debug Monitor Server) is a window oriented debugging environment.
      • Traceview is a utility which keeps track of all the method calls made by the application and the time spent in each call.

      DDMS starts and connects to Android Debug Bridge. When a device connects, a Virtual Machine (VM) monitoring services is created which monitors every minute activity. It keeps informed about initiation and termination of connected device’s VM. DDMS retrieves the VM's process ID (pid) by adb. It opens a connection to the VM's debugger by the adb daemon (adbd) on the device. Now, DDMS can communicate to VM. Thus, everything is monitored.


      Relationship between DDMS, ADB and Emulator

      Figure Relationship between DDMS, ADB and Emulator.

      Let us wind up with this section. Let us move to next chapter.