Thursday, February 16, 2012

How to publish Android Apps into an Android Market?

In this blog post, I am going to talk about the very basic steps that are mandatory to get application published in to Android Market. Android Market https://market.android.com is a store developed by Google for Android devices, it allows users to download published apps of different developers.
Follow the below procedure to generate a suitable .apk file for Android market.


1. Specify Version

To define the version information for application, set following attributes in the application’s manifest file:
android:versionCode - An integer value that represents the version of the application code
android:versionName – A string value that represents the release version of the application code
Versioning is required for following reasons:
  1. To check compatibility and dependency issues between applications.
  2. While Publishing and Upgrading the application to Android market
  3. It is also used in the Android Market to automatically offer application upgrades to users.
Here’s an example manifest file that shows the android:versionCode andandroid:versionName attributes in the <manifest> element.


<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="in.android.planner"

    android:versionCode="1"
    android:versionName="Planner_V2.0.4" >

2. Signing of Application

Google expects a Signed copy of the application in order to verify the developer account. The Android system will not install or run an application that is not signed. In preparation of signing the application, you must first ensure that you have a suitable private key, if you don’t have any private key then generate it with following 2 methods.
A. Using Command line tools
B. Using Eclipse ADT
A. Using Command line tools
Following are the 4 processes to generate published .apk file.
a. Obtain a suitable private key
Use following command to generate a private key:
$ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
Command line attributes:
  • -v = Verbose mode
  • my-release-key.keystore = generated key file
  • alias_name = alias name for application
  • validity = expiry time here is 10000
The above command generates the keystore as a file called my-release-key.keystore. The keystore and key are protected by the passwords you entered. The keystore is valid for 10000 days.
b. Compile the application in release mode
To export an unsigned .apk from Eclipse follows th steps:
  1. Right-click the project in the Package Explorer
  2. Select Android Tools > Export Unsigned Application Package.
  3. Then specify the file location for the unsigned .apk.
c. Sign your application with your private key
When application package is ready to be signed, then you can sign it by using the Jarsigner tool.
$ jarsigner -verbose -keystore my-release-key.keystore my_application.apk alias_name
Command line attributes:
  • -verbose = Verbose mode
  • my-release-key.keystore = generated key file.
  • alias_name = alias name for application
  • my_application.apk = unsigned application
While running the above command, Jarsigner prompts you to provide passwords for the keystore and key. It then signed the .apk file. Use following command to verify that your .apk is signed:
$ jarsigner -verify my_signed.apk
If the .apk is signed properly, Jarsigner prints “jar verified”.
d. Align the final APK package
Once you have signed the .apk with your private key, run zipalign on the file.The zipalign tool is available inside the Android SDK, tools/ directory folder. Follow the command to align your .apk file:
$ zipalign -v 4 your_project_name-unaligned.apk your_project_name.apk
The input .apk must be signed with your private key before you optimize the package with zipalign
B. Using Eclipse ADT
One of very important distribution requirements is that Android applications must be digitally signed with a certificate that the developer holds. This is used to ensure the authenticity of an application, so it’s important that you pick a strong password for your private key and ensure that you keep it safe.
So to start off, you’ll need a private key in order to sign your final APK file, as the debug key that IDEs use sign your compiled apps by default can’t be used.
If you’re using Eclipse, you can use the Export Wizard, a friendly GUI-based tool. Even if you use a different IDE, it might prove to save a lot of time if you use Eclipse for exporting your application, unless of course your IDE offers the same functionality.
Follow the steps to create a signed and aligned .apk by Eclipse ADT:
  1. Select the project in the Package and select File > Export.
  2. Open the Android folder, select Export Android Application, and click Next.
  3. The wizard now guide you the process of signing your application, including steps for selecting the private key or creating a new keystore and private key.
  4. Complete the Export Wizard and your application will be compiled, signed, aligned, and ready for distribution.



3. Preparing to Publish: A Checklist

Following checklist is useful while publishing android application to market.
  1. Complete your application testing extensively on an actual device
  2. Consider adding licensing support
  3. Specify an icon and label in the application’s manifest, you define the attributesandroid:icon and android:label in the <application> element of the manifest.
  4. Turn off logging and debugging and clean up data/files
  5. Remove the android:debuggable=”true” attribute from the <application> element of the manifest.
  6. Specifying an appropriate value for both the android:versionCode andandroid:versionName attributes of the <manifest> element in the application’s manifest file.
  7. Generate a private key by keytool utility and compile it with application by using release mode.
  8. In <manifest> file check that the proper permissions are used, so that user can grant permissions when application is installed in device.
  9. For supporting maximum screen sizes of devices used by customers, following attribute must be added in the Manifest file.
Google Ask's for the following details while uploading on the site.......


First of all go to market.android.com/publish 
Log in with your any existing gmail account or you can make a separate gmail account for this purpose. Your choice. 
The very first step is THE PAYMENT. First of all you have to pay 25 dollars. There is no paypal option. You have to pay with your any Online shopping Credit Card



Once you finished Payment step, you will taken to your developer's Home Page. Here you have to upload your App file which has extension .apk ( You will have to download your app as i mentioned in App Making Post ) .

Once you've registered, it's easy to upload your application to Android Market. From the home screen of the Developer Console, select "Upload Applications." You'll be asked to fill in the following information for your app.



Upload Assets 
  • APK file size: Maximum supported size is 50MB.
  • Draft application .apk file: When you upload an .apk file, it can be saved as a draft while you edit the other aspects of the list. 
Please note that package names for app files are unique and permanent, so please choose wisely. Package names cannot be deleted or re-used in the future.
  • Screenshots: 2 screenshots are required. The additional 6 are optional.
  • High-Resolution Application Icon: Required.
  • Promotional Graphic: Optional.
  • Feature Graphic: Optional.
  • Promotional Video: Optional.
Listing Details 
  • Language: This is to denote the language of your application. Default language is US English. More languages will become available as Android-powered devices become available in those languages.
  • Title: The name of your application as you would like it to appear in Android Market. You may add one per language.
  • Description: The visible description of your application in Android Market. Use the translate feature to translate your description into other languages. There is a 4000 character limit for this field.
  • Recent changes: The recent changes feature provides an opportunity for you to add notes about the changes specific to the newest version of your application. Use the recent changes field to inform your users about the changes in your application. Learn more about recent changes.
  • Promo text: Text that accompanies your promotional graphic in featured spots in Android Market
  • Application Type: Android Market is divided into 2 major application types: "Applications" and "Games." Please choose one.
  • Category: You must select a category for your application. Read more about categories.
Publishing options
  • Copy protection: Copy protection may help prevent applications from being copied from a device. It increases the amount of memory on the phone required to install the application. Android expects to deprecate copy protection soon.
  • Locations: These are the locations in which you may distribute your applications.
    • Not all locations listed currently have users with Android-powered devices.
    • You may select locations one-by-one or choose the "All current and future locations" option. This option means that, as Android adds more distribution locations, these locations will be enabled for your app. Before you check this option, please brush up on Export Compliance.
    • Note: At this time, you may only sell applications to users in these locations.
Contact information
  • You must pick one support channel for your app: Website, Email, or Phone
  • This information is viewable to users from Android Market
  • You may choose to offer multiple channels for support

No comments:

Post a Comment