Recipe 11.2 Exporting Your Application as an APK File

Android Versions
Level 1 and above
Source Code to Download from

When your application is completed and tested, and therefore ready to hit the market, you need to package it as an APK (Android Package) file. This recipe shows how you can do that in Eclipse.


To export your application as an APK file, first ensure that the application compiles successfully. Then, right-click on the project name in Eclipse and select Export… (see Figure 11-7).

In the Export dialog, expand the Android item and select Export Android Application (see Figure 11-8). Click Next.

You are asked to select a project to export. Because you have already selected the project to export, the project name is filled in for you automatically (see Figure 11-9). Click Next.

You are now asked for a keystore (certificate) to code-sign the application. You can either use an existing keystore or create a new one. If you do not already have your own self-generated keystore, you can create a new one here. Enter a location to save the new keystore and supply a password ...

Get Android Application Development Cookbook: 93 Recipes for Building Winning Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.