Amazon Developer Blogs

Amazon Developer Blogs

Showing posts tagged with manifest

April 12, 2011

Winkie Chen

The manifest of your Android app provides essential information about the app to the Amazon Appstore for Android. Your app must include an “AndroidManifest.xml” file in the root directory.

The Amazon Appstore uses the app manifest file to ensure we merchandise apps appropriately. Prior to submitting your app to Amazon, please ensure the manifest is packaged with your app and includes the following elements and data:

• VersionName: A string value that represents the release version of the application code, as it should be shown to users. The value is a string so that you can describe the application version as a <major>.<minor>.<point> string, or as any other type of absolute or relative version identifier. There is a hundred-character maximum on the length of the version name string.

• Uses-sdk: Tells us which OS the app runs on.

• Uses-configuration: Tells us which configuration is required by the app. (This element may be left empty if nothing is required.)

• Uses-feature: Tells us which features of the phone are used, such as the camera. (This section may be left empty if there are no required features.)

• Supports-screens: Tells us if the app supports large and/or high-intensity screens

• Uses-permissions: These are Android permissions and are required by the platform. (This should NOT be present if your app does not require permissions.)


Below is an example manifest structure with required elements in red:

<manifest versionName="string">

    <uses-permission />

    <permission />

    <permission-tree />

    <permission-group />

    <instrumentation />

    <uses-sdk />

    <uses-configuration />

    <uses-feature />

    <supports-screens />

     <application>

        <activity>

            <intent-filter>

                <action />

                <category />

                <data />

            </intent-filter>

            <meta-data />

        </activity>

         <activity-alias>

            <intent-filter> . . . </intent-filter>

            <meta-data />

        </activity-alias>

         <service>

            <intent-filter> . . . </intent-filter>

            <meta-data/>

        </service>

         <receiver>

            <intent-filter> . . . </intent-filter>

            <meta-data />

        </receiver>

        <provider>

            <grant-uri-permission />

            <meta-data />

        </provider>

         <uses-library />

    </application>

</manifest>
 

If you do not have any data for a certain element--for instance, if your app does not utilize any permission--you should remove that element entirely instead of leaving it empty.  Empty elements can cause issues in the ingestion process.  Also, make sure your app only requests permissions that it actually needs to function properly.  Unnecessary permission requests can cause a spyware or malware concern from a customer’s perspective.

If your manifest does not comply with this set of rules, it may be rejected directly by the Developer Portal or in the app approval phase.

You can find more information about the AndroidManifest.xml File on the Android Dev Guide:

http://developer.android.com/guide/topics/manifest/manifest-intro.html

January 17, 2011

peracha

Whether you have a bug fix, enhancement or performance optimization that you want to deliver to your customers, one of your Android apps will inevitably require an upgrade.  This can be either a seamless process or a painful one for your customers.  To ensure that it is the former and not the latter, the Android SDK provides some simple guidelines to help you manage this process.  Last week, we discussed some useful configuration settings offered through AndroidManifest.xml for designing apps to run on smartphones and tablets.  This same configuration file also provides settings to version your apk.

There are two attributes you can specify to manage the versioning process of your app:

  • android:versionName
  • android:versionCode

The versionName attribute is a user facing string that identifies the version of the application in use.  For example, if you are upgrading for the first time, your previous versionName may be “1.0” while a minor upgrade version would be indicated by “1.1” and a major upgrade by “2.0”.  The versionName attribute is primarily used for display purposes and helps users identify differences between app versions.  The following is a snippet of the manifest from the Amazon MP3 App for Android:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.amazon.mp3"
      android:versionCode="80029"
      android:versionName="1.8.29">

        ...
</manifest>

The versionCode is the attribute that is used by the Amazon Appstore for Android to compare versions of your app.  This is an integer, like 80029 in the sample manifest, not a string like the versionName.  If the versionCode of an apk is greater than the versionCode of another apk, then it is considered to be newer.  Of course, for this comparison to be valid, the apk package name and signature must also match.  To avoid unexpected behavior, it is extremely important to keep track of your versionCode and to always increase the value whenever you are releasing a new version.