android dev lecture17

27
Mobile Application Development Android Application Development Lecture 17

Upload: -

Post on 08-Nov-2015

217 views

Category:

Documents


1 download

DESCRIPTION

هخ

TRANSCRIPT

Mobile Application Development

Mobile Application Development Android Application Development

Lecture 17OutlineChapter 12: Publishing Android ApplicationsPreparing for PublishingDeploying APK FilesPublishing Android Applications

12ObjectivesHow to prepare your application for deploymentExporting your application as an APK file and signing it with a new certificateHow to distribute your Android applicationPublishing your application on the Android MarketPublishing StepsThe steps to publishing your Android application:Export your application as an APK (Android Package) file.Generate your own self-signed certificate and digitally sign your application with it.Deploy the signed application.Use the Android Market for hosting and selling your application.Versioning Your Application

Application AttributesIf you are planning to publish your application on the Android Market, the AndroidManifest.xml file must have the following attributes:android:versionCode (within the element)android:versionName (within the element)android:icon (within the element)android:label (within the element)

Digital SigningAll Android applications must be digitally signed before they are allowed to be deployed onto a device.Eclipse uses a default debug keystore (appropriately named debug.keystore) to sign your application. A keystore is commonly known as a digital certificate.Keystore

Exporting and Signing an Android ApplicationStep 1Select the LBSproject in Eclipse and then select File Export Exporting and Signing an Android ApplicationStep 2In the Export dialog, expand the Android item and select Export Android Application. Click Next.

Exporting and Signing an Android ApplicationStep 3The LBS project should now be displayed. Click Next.

Exporting and Signing an Android ApplicationStep 4Select the Create new keystore option to create a new certificate (keystore) for signing your application. Enter a path to save your new keystore and then enter a password to protect the keystore. Click Next.

Exporting and Signing an Android ApplicationStep 5Provide an alias for the private key and enter a password to protect the private key. According to Google, your application must be signed with a cryptographic private key whose validity period ends after 22 October 2033. Hence, enter a number that is greater than 2033 minus the current year. Finally, enter your name in the field labeled First and Last Name. Click Next.

Exporting and Signing an Android ApplicationStep 6Enter a path to store the destination APK file. Click Finish. The APK file will now be generated.

Exporting and Signing an Android ApplicationStep 7Deploy the debug.keystores MD5 fingerprint.

Exporting and Signing an Android ApplicationStep 8Using the MD5 fi ngerprint obtained from the previous step, go to http://code.google.com/android/add-ons/google-apis/maps-api-signup.htmland sign up for a new Maps API key.Exporting and Signing an Android ApplicationStep 9Enter the new Maps API key in the main.xml file:

Exporting and Signing an Android ApplicationStep 10With the new Maps API key entered in the main.xml file, you now need to export the application once more and resign it. Repeat steps 2 through 4. When you are asked to select a keystore, select the Use existing keystore option (and enter the password you used earlier to protect your keystore. Click Next.

Exporting and Signing an Android ApplicationStep 11Select the Use existing key option and enter the password you set earlier to secure the private key (enter the password). Click Next.

Exporting and Signing an Android ApplicationStep 12Click Finish to generate the APK file again.

Exporting and Signing an Android ApplicationThats it! The APK is now generated and contains the new Map API key that is tied to the new keystore.Deploying APK FilesAfter you have signed your APK files, you need a way to get them onto your users devices. Three methods can be used:Deploying manually using the adb.exe tool.Hosting the application on a web server.Publishing through the Android Market.Publishing on the Android MarketTo publish your application two steps should be done:Creating a Developer ProfileSubmitting Your Apps

Creating a Developer Profile

Submitting Your Apps

Questions?