Android Eclipse Emulator --launching apk directly

 

WHY?????    

  • Because may get a third party applicaiton you want to interface to and use. This is possible in Android. Very powerful Idea. In the example below we are installing the BarCode Scanner application from ZXING.
    • "One of the great strengths of the Android mobile platform is that there is a well defined interface for applications to communicate with one-another. This makes it so that functions and features of one application can utilize functions and features of another application to build something new."
  • Another reason--may want to send someone your apk for testing.

Step 1: Launch Emulator

  • Option 1: run an existing Android project (it will have its own apk...not the one we are trying to install) to get Emulator up
  • Option 2: create dummy new Android project just to run it and get the Emulator up
  • Option 3: launch emulator directly ( $SDK_ROOT/tools directory and execute the file 'emulator.exe'. on my machine the path is C:\android-sdk-windows\tools this may be different on your machine)

 

 

Step 2: Download your (probably 3rd party) apk Android Applcation file to your computer

  • put it in your Adroid Emulator's tools directory!!!!!
  • on my computer this is C:\android-sdk-windows\tools (yours may be different)
  • Suppose I am grabbing the ZXING barcode app, it is called BarcodeScanner3.72.apk

 

Step 3: Install the apk in the existing running emulator

  • open cmd window
  • cd C:\android-sdk-windows\tools (or your directory)
  • execute the following command:      adb install BarcodeScanner3.72.apk
    • Note: the C:\android-sdk-windows\platform-tools must be in your environment variables if it is to find the adb.exe program
    • Note: the name of your apk will be different if you are not installing the ZXING Barcode Scanner App
  • Example Results

Install apk

Here we see the Barcode application is installed along with some other (MyCamera, CS6825_Project4) applications that I have created

Results of Installing APK

NOTE: this will only be good for the Run time of this emulator...you will have to go back through the previous steps each time you kill and re-run the emulator to get the apk installed