diff options
-rw-r--r-- | android/README | 10 | ||||
-rw-r--r-- | android/android.make | 39 |
2 files changed, 25 insertions, 24 deletions
diff --git a/android/README b/android/README index 81cd416107..2b1bd2ab6c 100644 --- a/android/README +++ b/android/README | |||
@@ -20,16 +20,10 @@ Use this as your build folder, using '../tools/configure' etc. | |||
20 | $ ../tools/configure # type 200, then chose A for android and your screen resolution | 20 | $ ../tools/configure # type 200, then chose A for android and your screen resolution |
21 | $ make | 21 | $ make |
22 | 22 | ||
23 | After the build finished, build the zip file: | 23 | After the build finished, build the apk file: |
24 | $ make zip | ||
25 | |||
26 | Create a debug signing key: | ||
27 | $ keytool -genkey -alias androiddebugkey -keystore $HOME/.android/debug.keystore -storepass android -keypass android -validity 365 -dname "CN=Android Debug,O=Android,C=US" | ||
28 | |||
29 | Then, you can create a Rockbox.apk which ends up in bin/ | ||
30 | $ make apk | 24 | $ make apk |
31 | 25 | ||
32 | You can install that on the device: | 26 | You can install that on your device or emulator with the following command: |
33 | $ $ANDROID_SDK_PATH/tools/adb install -r bin/Rockbox.apk | 27 | $ $ANDROID_SDK_PATH/tools/adb install -r bin/Rockbox.apk |
34 | 28 | ||
35 | 29 | ||
diff --git a/android/android.make b/android/android.make index 16fdb12e45..8cb52bbbba 100644 --- a/android/android.make +++ b/android/android.make | |||
@@ -19,17 +19,18 @@ PACKAGE_PATH=org/rockbox | |||
19 | ANDROID_DIR=$(ROOTDIR)/android | 19 | ANDROID_DIR=$(ROOTDIR)/android |
20 | BINLIB_DIR=$(BUILDDIR)/libs/armeabi | 20 | BINLIB_DIR=$(BUILDDIR)/libs/armeabi |
21 | 21 | ||
22 | |||
23 | java2class = $(addsuffix .class,$(basename $(subst $(ANDROID_DIR),$(BUILDDIR),$(1)))) | 22 | java2class = $(addsuffix .class,$(basename $(subst $(ANDROID_DIR),$(BUILDDIR),$(1)))) |
24 | 23 | ||
24 | # API version | ||
25 | ANDROID_PLATFORM_VERSION=8 | 25 | ANDROID_PLATFORM_VERSION=8 |
26 | |||
27 | ANDROID_PLATFORM=$(ANDROID_SDK_PATH)/platforms/android-$(ANDROID_PLATFORM_VERSION) | 26 | ANDROID_PLATFORM=$(ANDROID_SDK_PATH)/platforms/android-$(ANDROID_PLATFORM_VERSION) |
27 | |||
28 | # android tools | ||
28 | AAPT=$(ANDROID_PLATFORM)/tools/aapt | 29 | AAPT=$(ANDROID_PLATFORM)/tools/aapt |
29 | DX=$(ANDROID_PLATFORM)/tools/dx | 30 | DX=$(ANDROID_PLATFORM)/tools/dx |
30 | APKBUILDER=$(ANDROID_SDK_PATH)/tools/apkbuilder | 31 | APKBUILDER=$(ANDROID_SDK_PATH)/tools/apkbuilder |
31 | ZIPALIGN=$(ANDROID_SDK_PATH)/tools/zipalign | 32 | ZIPALIGN=$(ANDROID_SDK_PATH)/tools/zipalign |
32 | 33 | KEYSTORE=$(HOME)/.android/debug.keystore | |
33 | 34 | ||
34 | MANIFEST := $(ANDROID_DIR)/AndroidManifest.xml | 35 | MANIFEST := $(ANDROID_DIR)/AndroidManifest.xml |
35 | 36 | ||
@@ -53,17 +54,19 @@ DIRS += $(subst ___,data,$(_DIRS)) | |||
53 | DIRS += $(BUILDDIR)/libs/armeabi | 54 | DIRS += $(BUILDDIR)/libs/armeabi |
54 | 55 | ||
55 | $(R_JAVA) $(AP_): $(MANIFEST) | 56 | $(R_JAVA) $(AP_): $(MANIFEST) |
56 | $(call PRINTS,AAPT $(subst $(BUILDDIR)/,,$@))$(AAPT) package -f -m -J $(BUILDDIR)/gen -M $(MANIFEST) -S $(ANDROID_DIR)/res -I $(ANDROID_PLATFORM)/android.jar -F $(AP_) | 57 | $(call PRINTS,AAPT $(subst $(BUILDDIR)/,,$@))$(AAPT) package -f -m \ |
58 | -J $(BUILDDIR)/gen -M $(MANIFEST) -S $(ANDROID_DIR)/res \ | ||
59 | -I $(ANDROID_PLATFORM)/android.jar -F $(AP_) | ||
57 | 60 | ||
58 | $(BUILDDIR)/bin/$(PACKAGE_PATH)/R.class: $(R_JAVA) | 61 | $(BUILDDIR)/bin/$(PACKAGE_PATH)/R.class: $(R_JAVA) |
59 | $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$<))javac -d $(BUILDDIR)/bin \ | 62 | $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$<))javac -d $(BUILDDIR)/bin \ |
60 | -classpath $(ANDROID_PLATFORM)/android.jar:$(BUILDDIR)/bin -sourcepath \ | 63 | -classpath $(ANDROID_PLATFORM)/android.jar:$(BUILDDIR)/bin \ |
61 | $(ANDROID_DIR)/gen:$(ANDROID_DIR)/src $< | 64 | -sourcepath $(ANDROID_DIR)/gen:$(ANDROID_DIR)/src $< |
62 | 65 | ||
63 | $(BUILDDIR)/bin/$(PACKAGE_PATH)/%.class: $(ANDROID_DIR)/src/$(PACKAGE_PATH)/%.java | 66 | $(BUILDDIR)/bin/$(PACKAGE_PATH)/%.class: $(ANDROID_DIR)/src/$(PACKAGE_PATH)/%.java |
64 | $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$<))javac -d $(BUILDDIR)/bin \ | 67 | $(call PRINTS,JAVAC $(subst $(ROOTDIR)/,,$<))javac -d $(BUILDDIR)/bin \ |
65 | -classpath $(ANDROID_PLATFORM)/android.jar:$(BUILDDIR)/bin -sourcepath \ | 68 | -classpath $(ANDROID_PLATFORM)/android.jar:$(BUILDDIR)/bin \ |
66 | $(ANDROID_DIR)/gen:$(ANDROID_DIR)/src $< | 69 | -sourcepath $(ANDROID_DIR)/gen:$(ANDROID_DIR)/src $< |
67 | 70 | ||
68 | $(DEX): $(R_OBJ) $(JAVA_OBJ) | 71 | $(DEX): $(R_OBJ) $(JAVA_OBJ) |
69 | $(call PRINTS,DX $(subst $(BUILDDIR)/,,$@))$(DX) --dex --output=$@ $(BUILDDIR)/bin | 72 | $(call PRINTS,DX $(subst $(BUILDDIR)/,,$@))$(DX) --dex --output=$@ $(BUILDDIR)/bin |
@@ -75,32 +78,36 @@ dex: $(DEX) | |||
75 | $(BINLIB_DIR)/$(BINARY): $(BUILDDIR)/$(BINARY) | 78 | $(BINLIB_DIR)/$(BINARY): $(BUILDDIR)/$(BINARY) |
76 | $(call PRINTS,CP $(BINARY))cp $^ $@ | 79 | $(call PRINTS,CP $(BINARY))cp $^ $@ |
77 | 80 | ||
78 | $(BUILDDIR)/rockbox.zip: | 81 | $(BUILDDIR)/rockbox.zip: zip |
79 | 82 | ||
80 | $(BINLIB_DIR)/libmisc.so: $(BUILDDIR)/rockbox.zip | 83 | $(BINLIB_DIR)/libmisc.so: $(BUILDDIR)/rockbox.zip |
81 | $(call PRINTS,CP rockbox.zip)cp $^ $@ | 84 | $(call PRINTS,CP rockbox.zip)cp $^ $@ |
82 | 85 | ||
83 | libs: $(LIBS) | 86 | libs: $(LIBS) |
84 | 87 | ||
85 | $(TEMP_APK): $(LIBS) $(DEX) | 88 | $(TEMP_APK): $(DIRS) $(LIBS) $(DEX) |
86 | $(call PRINTS,APK $(subst $(BUILDDIR)/,,$@))$(APKBUILDER) $@ \ | 89 | $(call PRINTS,APK $(subst $(BUILDDIR)/,,$@))$(APKBUILDER) $@ \ |
87 | -u -z $(AP_) -f $(DEX) -nf $(BUILDDIR)/libs | 90 | -u -z $(AP_) -f $(DEX) -nf $(BUILDDIR)/libs |
88 | 91 | ||
89 | $(APK): $(TEMP_APK) | 92 | $(KEYSTORE): |
93 | $(call PRINTS,KEYTOOL debug.keystore)keytool -genkey \ | ||
94 | -alias androiddebugkey -keystore $@ \ | ||
95 | -storepass android -keypass android -validity 365 \ | ||
96 | -dname "CN=Android Debug,O=Android,C=US" | ||
97 | |||
98 | $(APK): $(TEMP_APK) $(BUILDDIR)/rockbox.zip $(KEYSTORE) | ||
90 | $(SILENT)rm -f $@ | 99 | $(SILENT)rm -f $@ |
91 | $(call PRINTS,SIGN $(subst $(BUILDDIR)/,,$@))jarsigner \ | 100 | $(call PRINTS,SIGN $(subst $(BUILDDIR)/,,$@))jarsigner \ |
92 | -keystore "$(HOME)/.android/debug.keystore" -storepass "android" \ | 101 | -keystore "$(KEYSTORE)" -storepass "android" -keypass "android" \ |
93 | -keypass "android" -signedjar $(TEMP_APK2) $^ "androiddebugkey" | 102 | -signedjar $(TEMP_APK2) $(TEMP_APK) "androiddebugkey" |
94 | $(SILENT)$(ZIPALIGN) -v 4 $(TEMP_APK2) $@ > /dev/null | 103 | $(SILENT)$(ZIPALIGN) -v 4 $(TEMP_APK2) $@ > /dev/null |
95 | $(SILENT)rm $(TEMP_APK) $(TEMP_APK2) | ||
96 | 104 | ||
97 | $(DIRS): | 105 | $(DIRS): |
98 | $(SILENT)mkdir -p $@ | 106 | $(SILENT)mkdir -p $@ |
99 | 107 | ||
100 | dirs: $(DIRS) | 108 | dirs: $(DIRS) |
101 | 109 | ||
102 | apk: $(DIRS) $(APK) | 110 | apk: $(APK) |
103 | 111 | ||
104 | clean:: | 112 | clean:: |
105 | $(SILENT)rm -f $(BUILDDIR)/bin/$(PACKAGE_PATH)/*.class $(R_JAVA) $(TEMP_APK) $(TEMP_APK2) $(APK) $(DEX) $(BUILDDIR)/_rockbox.zip $(AP_) $(LIBS) | 113 | $(SILENT)rm -f $(BUILDDIR)/bin/$(PACKAGE_PATH)/*.class $(R_JAVA) $(TEMP_APK) $(TEMP_APK2) $(APK) $(DEX) $(BUILDDIR)/_rockbox.zip $(AP_) $(LIBS) |
106 | |||