Creating an APK File Using Eclipse

The following exercise walks you through creating an APK file using Eclipse:

  1. Open Eclipse, and choose the proper workspace for your application.
  2. Right-click the app name at the top of Package Explorer, as shown in the highlighted section in Figure 9-6.
    images

    Figure 9-6. A completed Android program—a prerequisite for submitting your application to the Android Market. Note that there are no red Xs, which means the program is running without errors.

  3. Choose Android Tools, and then choose Export Signed Application Package. Notice that there is an option for Export Unsigned Application Package. You don’t want to use that now. When you pick the Export Signed Application Package, you should see a window that looks just like Figure 9-7. Verify that you have the right project selected, and click Next.
    images

    Figure 9-7. What you will see after you export your signed application package

  4. Here you will need to set up a keystore for the first time, assuming you have not done it already. You will then see the window in Figure 9-8.

    images Note Just like your house keys, you should have a copy of your keystore safely backed up somewhere. You should make a compressed or zipfile of your keystore and save it in a secure and easily locatable place on your computer.

    images

    Figure 9-8. What you will see when using a keystore

  5. Check “Create new keystore.” You will now need to enter a location on your hard drive for where you want your keystore. I put mine where my workspaces are for Eclipse, which makes it easier to remember. Pick a password that you can easily remember, and confirm it.
  6. If you already have a keystore, you now just need to choose the correct alias. I go into more detail on this in Chapter 11. For now, go ahead and click Finish, and you will see the window shown in Figure 9-9.
    images

    Figure 9-9. The Export Android Application screen, for setting up a key

  7. Now it’s time to enter an alias. In this example, I chose Mark007 for fun. Then you must enter a password specifically for the alias, and again reconfirm it. As for the validity, this key is designed to expire after October 22, 2033. According to the Android Developers site, the market server “enforces the requirement to ensure that users can seamlessly upgrade Market applications when new versions are available.” Since many of the sites recommend choosing 30 years, this is what I used, as you can see.
  8. Next, enter your first and last name, and fill in the Organizational Unit, Organization, City or Locality, State or Province, and Country Code (XX) fields. A country code is a two-letter code supplied by the International Organization for Standardization (ISO). You can find a list of them all at www.worldatlas.com/aatlas/ctycodes.htm.
  9. Click Next, and you will see the screen shown in Figure 9-10.
    images

    Figure 9-10. Where to put the destination and key/certificate checks

  10. Click Finish, and go ahead and enter the path where you want to keep your keystore.
..................Content has been hidden....................

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