summaryrefslogtreecommitdiffstats
path: root/android
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2014-03-09 18:08:06 +0100
committerThomas Martitz <kugel@rockbox.org>2014-03-09 18:11:35 +0100
commit6499ce3e445e1acc5f5707fd164ad5e3c5ab0a43 (patch)
tree3e1cb19678e5ce9bfd5681d944193ede902805b6 /android
parent2a71c0853304b68835fcf87d2bae8295d64abd6c (diff)
downloadrockbox-6499ce3e445e1acc5f5707fd164ad5e3c5ab0a43.tar.gz
rockbox-6499ce3e445e1acc5f5707fd164ad5e3c5ab0a43.tar.bz2
rockbox-6499ce3e445e1acc5f5707fd164ad5e3c5ab0a43.zip
android: Get the port up and running again
The build system needed fixes because the tools paths changed and one tool that we used (apkbuilder) was removed entirely. Recent NDKs don't ship gcc 4.4.3 anymore, therefore switch to 4.6. The code itself needed a fix for a jni reference bug that was uncovered by KitKat. The port now builds with latest sdk (r22) and ndk (r9d). Change-Id: Id74fa54ba93bbb0ee30373fbe79e92c5ff03201d
Diffstat (limited to 'android')
-rw-r--r--android/.classpath1
-rw-r--r--android/android.make12
-rwxr-xr-xandroid/buildapk.sh19
-rw-r--r--android/project.properties2
-rw-r--r--android/src/org/rockbox/RockboxFramebuffer.java10
5 files changed, 29 insertions, 15 deletions
diff --git a/android/.classpath b/android/.classpath
index 0ca188f976..dec02b33c6 100644
--- a/android/.classpath
+++ b/android/.classpath
@@ -4,5 +4,6 @@
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="gen"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
+ <classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
diff --git a/android/android.make b/android/android.make
index 6d10121952..4c93aa72cc 100644
--- a/android/android.make
+++ b/android/android.make
@@ -28,16 +28,17 @@ $(CPUFEAT_BUILD)/cpu-features.o: $(CPUFEAT)/cpu-features.c
.PHONY: apk classes clean dex dirs libs jar
# API version
-ANDROID_PLATFORM_VERSION=16
+ANDROID_PLATFORM_VERSION=19
ANDROID_PLATFORM=$(ANDROID_SDK_PATH)/platforms/android-$(ANDROID_PLATFORM_VERSION)
# android tools
-AAPT=$(ANDROID_SDK_PATH)/platform-tools/aapt
-DX=$(ANDROID_SDK_PATH)/platform-tools/dx
-APKBUILDER=$(ANDROID_SDK_PATH)/tools/apkbuilder
+BUILD_TOOLS_VERSION=19.0.3
+AAPT=$(ANDROID_SDK_PATH)/build-tools/$(BUILD_TOOLS_VERSION)/aapt
+DX=$(ANDROID_SDK_PATH)/build-tools/$(BUILD_TOOLS_VERSION)/dx
ZIPALIGN=$(ANDROID_SDK_PATH)/tools/zipalign
KEYSTORE=$(HOME)/.android/debug.keystore
ADB=$(ANDROID_SDK_PATH)/platform-tools/adb
+BUILDAPK=$(ANDROID_DIR)/buildapk.sh
CLASSPATH := $(BUILDDIR)/bin/classes
@@ -130,8 +131,7 @@ $(BINLIB_DIR)/lib%.so: $(RBCODEC_BLD)/codecs/%.codec
libs: $(DIRS) $(LIBS)
$(TEMP_APK): $(AP_) $(LIBS) $(DEX) | $(DIRS)
- $(call PRINTS,APK $(subst $(BUILDDIR)/,,$@))$(APKBUILDER) $@ \
- -u -z $(AP_) -f $(DEX) -nf $(BUILDDIR)/libs
+ $(call PRINTS,APK $(subst $(BUILDDIR)/,,$@))$(BUILDAPK) $(BUILDDIR) $(notdir $@) $(BUILD_TOOLS_VERSION)
$(KEYSTORE):
$(SILENT)mkdir -p $(HOME)/.android
diff --git a/android/buildapk.sh b/android/buildapk.sh
new file mode 100755
index 0000000000..340438721a
--- /dev/null
+++ b/android/buildapk.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+BUILDDIR=$1
+APK=$2
+SDKV=$3
+
+[ -z $ANDROID_SDK_PATH ] && exit 1
+[ -z $BUILDDIR ] && exit 1
+[ -d $BUILDDIR ] || exit 1
+
+# need to cd into the bin dir and create a symlink to the libraries
+# so that aapt puts the libraries with the correct prefix into the apk
+cd $BUILDDIR/bin
+ln -nfs $BUILDDIR/libs lib
+cp resources.ap_ $APK
+$ANDROID_SDK_PATH/build-tools/$SDKV/aapt add $APK classes.dex > /dev/null
+$ANDROID_SDK_PATH/build-tools/$SDKV/aapt add $APK lib/*/* > /dev/null
+
+exit 0
diff --git a/android/project.properties b/android/project.properties
index 895c9ce2eb..a5578ba094 100644
--- a/android/project.properties
+++ b/android/project.properties
@@ -8,4 +8,4 @@
# project structure.
# Project target.
-target=android-16
+target=android-19
diff --git a/android/src/org/rockbox/RockboxFramebuffer.java b/android/src/org/rockbox/RockboxFramebuffer.java
index e1fb99f2a1..405a771274 100644
--- a/android/src/org/rockbox/RockboxFramebuffer.java
+++ b/android/src/org/rockbox/RockboxFramebuffer.java
@@ -57,14 +57,6 @@ public class RockboxFramebuffer extends SurfaceView
setEnabled(false);
}
- /* second stage init; called from Rockbox with information about the
- * display framebuffer */
- private void initialize(int lcd_width, int lcd_height)
- {
- btm = Bitmap.createBitmap(lcd_width, lcd_height, Bitmap.Config.RGB_565);
- setEnabled(true);
- }
-
private void update(ByteBuffer framebuffer)
{
SurfaceHolder holder = getHolder();
@@ -138,5 +130,7 @@ public class RockboxFramebuffer extends SurfaceView
public native void surfaceDestroyed(SurfaceHolder holder);
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height)
{
+ btm = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
+ setEnabled(true);
}
}