jar tf bin/MainActivity.apk
res/layout/main.xml
AndroidManifest.xml
resources.arsc
classes.dex
Where are the classes? They are in the classes.dex file. This is a special binary file format which wraps a set of ordinary Java classes.
AndroidManifest.xml seems like it would be a simple copy of the AndroidManifest.xml that's in the application source directory. It isn't. It's some binary format, which presumably contains the same information in a format which is quicker for Android to process.
With the emulator running, use the adb tool to copy the MainActivity.apk file over into the emulator's virtual memory:
adb install bin/MainActivity.apk
45 KB/s (4130 bytes in 0.088s)
adb can connect to the emulator because the emulator listens on certain TCP ports which adb knows.
Click "all" on the emulator and the activity shows up:
Click on the app to run it, and you'll see the Hello World message.
The easier way to do all this is to run the emulator, and then use the build.xml script:
ant clean install
That does it all.
Share with your friends: |