Android - Steps for Signing & Making Publish Ready App.
Following are the steps involved in Signing and making your Android App publish ready. These steps should be followed in the same order as
written in this document while Publishing an App to Android Market. Before you
move towards the Signing and Publishing Steps; there are few things you
have to take care in your App.
- First of
all we need to do proper versioning of the App. Versioning is important
for the future updates. There are 2 fields in the Application Manifest file
that determines the version of the App. First is “android:versionCode” this represents the number of times the
app is being put on the App Store. For first time it is “1”. Second
Parameter is “
android:versionName
” this is the version that u want users to see. It is a string and can contain major,minor version name. e.g “0.8.5” - Once
versioning is done next thing is to declare minimum, target and maximum
API Level in the manifest file. Its good to mention just minimum SDK
Level.
- Disable : “Debuggable” & “Allow Clear User Data” in the Manifest File.
- Disable all the Logs in your app.
- Register for a Maps
API Key by sending the MD5 hash of the certificate with which we are going
to sign our application. Once we get the Maps Api key then we use it in our
application by mentioning this in the mapview layout( if your application
is using MapView element). There are 3 steps of generating Maps api key
for the application, first is to locate the “keytool” in your JDK, then
use it to generate the MD5 hash of the certificate with which you are
going to sign ur application. And finally use this MD5 hash to get the
maps Api key.
- To take the MD5
finger print hash of the certificate we first have to make sure that the
‘keytool’ is in our windows PATH variable. If not then add the path of the
keytool in ur environment variable. The keytool needed for generating the
MD5 hash is present in the “bin” directory of ur JDK i.e. the path will be
something like this: C:\Program
Files\Java\jdk1.6.0_17\bin
- Once u have added the
path of keytool in ur environment variables then open the command promp
and use the following command to generate the MD5 hash
keytool –list –alias Appkey
–keystore c:\MyKeystore
here the “Appkey” is an example
alias for the key present in the example keystore “MyKeystore” located on
the ‘C’ Drive
- The above
command will ask u for the password of the key and will then generate MD5
hash of the certificate.
- Go to http://code.google.com/android/maps-api-signup.html and
enter the MD5 fingerprint of the certificate calculated above
and hit the “Generate Api Key” Button and get the Google Maps Api key. Now
use it in the xml layout of the MapView.
- Now we can
proceed towards signing and publishing.
- You should
first Compile the application in Release Mode to get an Unsigned “.apk”
package, Sign it using the keystore and then finally Align the package
with zipalign.exe.
- The above
steps of Release Compile, Signing and Aligning can easily be done using
Eclipse Export tools. Moreover
it can also Create a KeyStore
if u don’t have one.
- Keystore
contains the keys being used by you for signing application. The keys can
be referenced in the keystore by there Alias.
Note: Keystore can contain number of Keys and each
key in the keystore references to a Certificate binded with it. Moreover, both
keystore and keys have their own Passwords however its more convenient to use
the same password for both keys and keystore.
Papa
Reference
No comments:
Post a Comment