Android application package file (APK) is program binary used to distribute and install Android application onto the Android operating system. Here we'll see step by step procedure of creating .apk file ready to be installed in Android device.

Tools & Technologies used in this article :

  1. JDK 1.6
  2. Eclipse 3.7
  3. Android SDK

There are two ways to export Application Package in Eclipse using Android Tools

  1. Export Unsigned Application Package
  2. Export Signed Application Package
Export Application Package

1. Export Unsigned Application Package

Right click on the Android project (say 'AndroidHello') and from the context menu select Android Tools --> Export Unsigned Application Package. Browse the location to save the apk and click Save button. Click Ok button in the following window to proceed.

Android Application Project

Note:
Android system will not allow to install an application on an emulator or a device unless it is digitally signed with a certificate whose private key is held by the application's developer.

2. Export Signed Application Package

Right click on the Android project (say 'AndroidHello') and from the context menu select Android Tools --> Export Signed Appliaction Package. Select the project to export and Click Next button.

Select Android Project to export

Keystore Selection

To publish the android application we need to create digitally signed apk. Here we'll create a self signed certificate / keystore. Click Create new keystore radio and provide the location and password for keystore. Click Next button.

Keystore Selection

Key Creation

Fill the form to create key and click Next button.

Key Creation

Destination and key/certificate checks

Browse the location where apk file will be saved and click Finish button.

Create Activity

Finally apk file will be created and ready for installation in android device.

AndroidHello.apk

References