Signing the android application manually In Eclipse, right click on the project & select Android Tools ->Export Unsigned

application package ->Select the path for exporting. For convenience, copy the exported .apk file to “C:\Program Files\Java\jdk1.6.0\bin\” folder. And if you wish to sign your application using the debug keystore, copy the debug.keystore file from “C:\Documents and Settings\Administrator\.android” to “C:\Program Files\Java\jdk1.6.0\bin\”. Then using jarsigner.exe tool (which is in same path), sign the application. In command prompt, give the following; C:\Program Files\Java\jdk1.6.0\bin> jarsigner –verbose –keystore debug.keystore nameoftheapk.apk androiddebugkey And when prompted for password, use default password “android”. To verify the .apk is signed, use C:\Program Files\Java\jdk1.6.0\bin> jarsigner –verify nameoftheapk.apk If the .apk is signed properly, jarsigner prints “jar verified”. For more details try one of these commands; C:\Program Files\Java\jdk1.6.0\bin> jarsigner –verify –verbose nameoftheapk.apk Or C:\Program Files\Java\jdk1.6.0\bin> jarsigner –verify –verbose –certs nameoftheapk.apk To Generate own Private Key C:\Program Files\Java\jdk1.6.0\bin> keytool –genkey –v –keystore name.keystore – alias name –keyalg RSA –keysize 2048 –validiy 10000 Running this command, keytool prompts you to provide passwords for the keystore and key, & to provide the Distinguished name fields for your key. It then generates the keystore as a file called name.keystore. The keystore and key are protected by the passwords you entered. The keystore contains a single key, valid for 10000 days. Finaly align the apk using zipalign tool.
zipalign -v 4 nameoftheapk.apk newnameoftheapk.apk
The -v flag turns on verbose output (optional). 4 is the byte-alignment (don't use anything other than 4). The first file argument is your signed .apk (the input) and the second file is the destination .apk file (the output). If you're overriding an existing .apk, add the -f

Signing the android application automatically using Eclipse ADT plug-in If you are using Eclipse with the ADT plugin, you can use the Export Wizard to export a signed .apk (and even create a new keystore, if necessary). The Export Wizard performs all the interaction with the Keytool and Jarsigner for you, which allows you to sign the package using a GUI instead of performing the manual procedures to compile, sign, and align, as discussed above. Once the wizard has compiled and signed your package, it will also perfom package alignment

which will guide you through the process of signing your application. backup files.apk (or creating a new keystore and private key). 5. Checklist to publish android application Before you consider your application ready for release: 1. but it is useful as a way to obtain the version number of an application. The Export Android Application wizard now starts. you define the attributes android:icon and android:label in the <application> element of the manifest. select Export Android Application. It should contain values in the this format: <major>. and ready for distribution. and click Next. Because the Export Wizard uses both Keytool and Jarsigner. you should ensure that they are accessible on your computer.<point> 7. • Remove log files. Test your application extensively on an actual device 2. Before you do the final compile of your application: 6. Specify an icon and label in the application's manifest • To specify an icon and label. This value is never used by the android system. • android:versionCode->represents the version number of your application. Register for a Maps API Key. including steps for selecting the private key with which to sign the . • android:versionName->contains versioning information that is visible to the users.<minor>. if your application is using MapView elements Compile your application After you compile your application: . • Deactivate any calls to Log methods in the source code. Consider adding licensing support 4. increment this value by 1 so that you can programmatically differentiate it from its previous version.apk in Eclipse: Select the project in the Package Explorer and select File > Export. • Check for private or proprietary data and remove it as necessary. Consider adding an End User License Agreement in your application 3. Version your application • Specify the android:minSdkVersion. and other unnecessary files from the application project. Complete the Export Wizard and your application will be compiled. To create a signed and aligned . Obtain a suitable cryptographic key 8. aligned. signed. Open the Android folder. Turn off logging and debugging and clean up data/files • Remove the android:debuggable="true" attribute from the <application> element of the manifest.with zipalign. For every revision you make the application. android:versionCode & android:versionName in the manifest file.

Once published. • Your application must define both an android:icon and an android:label attribute in the <application> element of its manifest. Your application must define both an android:versionCode and an android:versionName attribute in the <manifest> element of its manifest. Sign your application 10.android. and it displays the android:versionName to users as the application's version. To register as an Android Market developer and get started with publishing. download it.Test your compiled application Publishing application on Android Market To publish your application on Android Market. users can see your application. visit the Android Market: http://market. which are enforced by the Market server when you upload the application. Requirements enforced by the Android Market server: • • Your application must be signed with a cryptographic private key whose validity period ends after 22 October 2033. The server uses theandroid:versionCode as the basis for identifying the application internally and handling updates. and rate it using the Market application installed on their Android-powered devices. .9.com/publish If you plan to publish your application on Android Market. you can upload your application to the service whenever you want. Once you are registered. as many times as you want. you must make sure that it meets the requirements listed above (Checklists). and then publish it when you are ready. you first need to register with the service using your Google account and agree to the terms of service.

Sign up to vote on this title
UsefulNot useful