Signing your app before publishing to Google Play or Nook

                 Now your android application is ready and passed all tests. You surely want your application to go public. So you will publish it to android markets like Google Play,Amazon or Nook.

                 Before publishing the app to Google play or Nook you have to sign the app with your own keystore. So here we will discuss, how to make the keystore and then sign your app. Please note that currently to publish in amazon app market it is not mandatory to sign the app with your private keystore. But it is best practice to sign your app with your private keystore.

                The keystore data is needed when you wish to upgrade your app. Your application package can be signed with only one keystore. After publishing you can not sign the same package with different keystore. In that case if you wish to publish an upgrade, users get it as a new app,not an update.So, you should publish your app and its upgrades by signing with same keystore.

                So let us show how to make the keystore and then sign your app. We assume you are using eclipse IDE with ADT plugin for development. So select your project,then go to file and then export.

1st screenshot

          Now you will see a window like this. Here you press android to make it expand and then Export Android Application and after that hit next. Then another window will open like below image.

2nd screenshot

Here hit browse and select your project and after that next. You will get another window.

3rd screenshot

         Here select Create new Keystore. Then click browse to select a location to save your keystore and also give a name to your keystore. Then fill the password fields. The passwords must be greater or equal to six characters. This password is needed to access your private keystore for a later time. So you have to remember it. After then hit next and you will get the window to store keystore values.

Android application signing for publishing to Android market or real device installation...

If we want to publish an Android application we first need to write it.The result of our programming will be an .APK file which is the actual program binary of our application. However, the .APK file our compiler creates can only be used with the emulator on our desktop PC or Mac.One cannot use the same .APK file to install and run a application on the real Android phones available on market.


Why is that? Well, Google wants to protect its phone users from installing and running fraudulent software on their devices. Therefore, each and every application needs to be signed with a valid certificate that ensures where the application comes from. Meaning: the developer signs the application with his/her certificate to make sure it is always traceable where the application comes from. There are a bunch of more reasons to this so lets check out what Google is saying about this topic:
The important points to understand about signing Android applications are:
  • All applications must be signed. The system will not install an application that is not signed.
  • One can use self-signed certificates to sign their applications. No certificate authority is needed.
  • When we are ready to publish your application, we must sign it with a suitable private key. One can not publish an application that is signed with the default key generated by the SDK tools.
  • The system tests a signer certificate’s expiration date only at install time. If an application’s signer certificate expires after the application is installed, the application will continue to function normally.
  • One can use standard tools — Keytool and Jarsigner — to generate keys and sign the application .apk files.
3 Easy Steps for getting what we need to sign Applications...

  • Export unsigned application using Eclipse
    To do so we need to right-click package name and select Android Tools -> Export Unsigned Application. Then we should specify path to store our apk.
  • Generate your own certificate
    There is an utility in JDK – keytool.exe.We will use it to generate our own certificate. Command that will generate certificate for us looks like:
    keytool –genkey –v –keystore somename.keystore –alias somename –keyalg RSA –validity 10000
    We will be prompted for some info in a command line, including password we want to use for our keystore. We have to keep it safe. And we should keep in mind that our certificate should be valid till 22 October 2033. As a result keytool.exe will generate keystore named somename.keystore.We will use it to sign our Android applications.