Thursday, November 3, 2011

Create JAR suitable for use with Dalvikvm

1. Create
package org.apache;

public class HelloWorld {
public static void main(String[] args) {
2. Compile java:
javac -d . -g
3. Package Java Into a temporary jar
jar -cvf Temp.jar *
4. Use DX to generate classes.dex from Temp.jar
dx --dex --output=classes.dex Temp.jar
5. Use aapt to create new Jar (CmdLine.jar) suitable for use with Dalvikvm
aapt add CmdLine.jar classes.dex
6. Push Jar to folder:
adb shell
    mount -o remount /system
adb push CmdLine.jar /system/framework/
7. Restart:
adb reboot

No comments:

Post a Comment