How to Create a Distributable File

Now that you have your screenshots ready, you should also prepare an Android Package (APK) file. There are a few ways you can do this, but the one I will be focusing on is through the ADT inside the Eclipse IDE. If you did not use Eclipse to create your Android application, then you can use an automated build process, such as Hudson Continuous Integration Server. You can find out more about that at http://hudson-ci.org.

Eclipse automatically signs the Android application and compiles it in the APK file. (If you want to learn more about these packaging methods, then go to http://d.android.com/guide/publishing/app-signing.html.)

To publish on Android, you must digitally sign your file with certification that has a public/private key pair. Let me repeat this for emphasis: your Android application must be signed.

When it is time to release the application to the market, you must sign it in with a private key. You as the developer will have this key, and this certification is used to sign the application, which is in turn used to identify the application. The certificate is used to identify the author of an application, as well as establish a trust relationships between applications. It is possible to use self-signed certificates for signing your applications.

You may have noticed when you are checking your workspace files out that there is already an APK file there. This is because while you are developing and testing, you can compile in debug mode. The build tools use the Keytool utility included within the JDK to create a keystore with a known alias and password. The keystore is the container where your personal certificates are. During each compiling, the tools use the debug key to sign the application APK file.

You can use ADT tools to generate the certificate, and I will explain how to do that in the next section. If you don’t want to do it through Eclipse, another option is using standard tools like Keytool or Jarsigner in order to sign APK files. With the Keytool and Jarsigner approaches, you must first compile your application to an unsigned APK, and then sign the APK manually to generate your own private key using Jarsigner (or another similar tool). If you don’t have a private key already, you can then run Keytool manually to generate your own keystore/key, and sign into the application with Jarsigner.

Fortunately, Eclipse allows the user to create a keystore file. This is what Android uses to identify your application on the Android Market. I will go into detail on that on the next section, and I will assume that you programmed your application on Eclipse as opposed to another type of tool. If you want more information on signing your applications, you can learn more at http://d.android.com/guide/publishing/app-signing.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.12.157