Building and Running an Android Application
by, 02-11-2012 at 11:04 AM (1859 Views)
An Android project is compiled and packaged into “.apk” file. It is the container for application binary. It contains following information that is necessary to run your application on a device or emulator
• Compiled “.dex” files
• Binary version of Manifest file
• Compiled resources
• Uncompiled resource files for your application
If Eclipse is being used as development IDE, the ADT plug-in is responsible for building your project when source code is changes. Eclipse places “.apk” file into bin folder automatically.
In a non-Eclipse environment, “build.xml” ant file is used to build the project. This ant file calls the targets to build your application.
The application is signed using debug or release mode before running it on a device or emulator. While developing and testing an application, it is normally signed in debug mode. When the application is ready to release in the market, it is signed in release mode.
When you build an application, Eclipse sings it in debug mode for you. Eclipse can be configured to sign your application in release mode. The following diagram explains the building and running an application.
Building and Running Application
Different tools and processes produce many intermediate files while producing final “.apk” file. In Eclipse, build process is automatically done when you save code. In Non-Eclipse environment, this process is done every time when you run build script. The following diagram explains different tools and processes involved in building an application.
Tools and processes involved in building an application