Preparing an Android Application for Deployment

From Appmethod Topics
Jump to: navigation, search

Go Up to Android Mobile Application Development


Your Android app is deployed when you run it on an Android target device. You can also use the Deployment Manager to manage the deployed files. After your Android application is ready for final deployment, you can proceed to build and sign your application. See Deploying Your Signed Android Application.

Configuring the Options for Deploying Your Android App

You must configure several options for your Android app before you build the application for distribution. The properties that you configure are bundled with your application, in the AndroidManifest.xml file. You cannot modify these properties after you build and sign your application. Because these properties provide key information about your application, you should ensure that they contain the correct values before you deploy your application, or you might have to rebuild your application in order to change the configured values.

Before each release of your Android application, you should check that every setting is properly configured.

To configure your Android app:

  • On the Project > Options > Application page, provide the icons and images to represent your application.
  • On the Project > Options > Version Info page, increase the version code of your application. Application stores such as Google Play may require that newer versions of your application always have a higher version code than previous versions.
  • On the Project > Options > Uses Permissions page, define the permissions that your application requires to work.
  • On the Project > Options > Provisioning page, select in Target the build configuration that you want to use to deploy your application (for example, Release) and provide a KeyStore file if you have not already created one. This step is necessary in order to install your application in a device that has USB debugging disabled and to distribute your application to others. For more information about keystore files, see: http://docs.oracle.com/javase/1.5.0/docs/api/java/security/KeyStore.html.

Customizing Your AndroidManifest.xml File

Appmethod writes the options of your Android application to a special Android file, AndroidManifest.xml, which is included in your final Android package when you deploy your application for Android. This file defines things such as the version code or display name of your application, the list of permissions that your application requires, and so on.

Usually, you do not need to touch this file, and you can let Appmethod take care of everything for you. However, Appmethod allows you to customize the content of the AndroidManifest.xml file if you need to include custom data in this file that you can not define visually in your project options.

When you build an application for the Android target platform for the first time, Appmethod adds a file to your project folder: AndroidManifest.template.xml. Whenever you build your application for Android, Appmethod reads this file, replaces some placeholders in the file with actual values from your project options, and writes the resulting content into an output file: Android\<build configuration>\AndroidManifest.xml. This output file is the AndroidManifest.xml file that is included in the Android package that Appmethod generates when you deploy your application for the Android target platform.

To customize the output AndroidManifest.xml file of a single project, edit the content of AndroidManifest.template.xml.

The AndroidManifest.template.xml file that Appmethod adds to a project when you build that project for the Android target platform for the first time comes from %AppData%\Embarcadero\Studio\<n.n>\AndroidManifest.xml. If you want your new projects to have a different starting AndroidManifest.template.xml file, edit this file.

See Also