diff --git a/.gitignore b/.gitignore index 2e284b82..3bfe2333 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,9 @@ man6 xcuserdata .DS_Store xcshareddata + +# Android builds +Android/bin +Android/gen +Android/libs + diff --git a/Android/.classpath b/Android/.classpath new file mode 100644 index 00000000..7bc01d9a --- /dev/null +++ b/Android/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Android/AndroidManifest.xml b/Android/AndroidManifest.xml new file mode 100644 index 00000000..7c862696 --- /dev/null +++ b/Android/AndroidManifest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + diff --git a/Android/build.xml b/Android/build.xml new file mode 100644 index 00000000..4c672b9a --- /dev/null +++ b/Android/build.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Android/jni/Android.mk b/Android/jni/Android.mk new file mode 100644 index 00000000..23a25b7d --- /dev/null +++ b/Android/jni/Android.mk @@ -0,0 +1,15 @@ +LOCAL_PATH := $(call my-dir) + +include $(CLEAR_VARS) + +LOCAL_MODULE := apple2ix +LOCAL_SRC_FILES := jnihooks.c + +LOCAL_LDLIBS := -llog -landroid + +# Build a shared library and let Java/Dalvik drive +include $(BUILD_SHARED_LIBRARY) + +# --OR-- Build an executable so native can drive this show +#include $(BUILD_EXECUTABLE) + diff --git a/Android/jni/jnihooks.c b/Android/jni/jnihooks.c new file mode 100644 index 00000000..4d88d68c --- /dev/null +++ b/Android/jni/jnihooks.c @@ -0,0 +1,42 @@ +/* + * Apple // emulator for *nix + * + * This software package is subject to the GNU General Public License + * version 2 or later (your choice) as published by the Free Software + * Foundation. + * + * THERE ARE NO WARRANTIES WHATSOEVER. + * + */ + +#include +#include + +#define LOG(fmt, ...) __android_log_print(ANDROID_LOG_ERROR, "apple2ix", fmt, __VA_ARGS__) + +#define LAUNCH_WITHOUT_JAVA 0 +#if LAUNCH_WITHOUT_JAVA + +int main(int argc, char **argv) { + for (unsigned int i=0; i<10; i++) { + LOG("counter : %u", i); + sleep(1); + } + LOG("%s", "finished..."); +} + +#else + +void Java_org_deadc0de_apple2_Apple2Activity_nativeOnCreate(JNIEnv *env, jobject obj) { + LOG("%s", "native onCreate..."); +} + +void Java_org_deadc0de_apple2_Apple2Activity_nativeOnResume(JNIEnv *env, jobject obj) { + LOG("%s", "native onResume..."); +} + +void Java_org_deadc0de_apple2_Apple2Activity_nativeOnPause(JNIEnv *env, jobject obj) { + LOG("%s", "native onPause..."); +} + +#endif diff --git a/Android/jni/run.sh b/Android/jni/run.sh new file mode 100755 index 00000000..3dff6b96 --- /dev/null +++ b/Android/jni/run.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +ndk-build NDK_DEBUG=1 && \ + ant -f ../build.xml debug install && \ + adb shell am start -a android.intent.action.MAIN -n org.deadc0de.apple2/.Apple2Activity diff --git a/Android/local.properties b/Android/local.properties new file mode 100644 index 00000000..abeb5205 --- /dev/null +++ b/Android/local.properties @@ -0,0 +1,10 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. + +# location of the SDK. This is only used by Ant +# For customization when using a Version Control System, please read the +# header note. +sdk.dir=/home/asc/Android/Sdk diff --git a/Android/project.properties b/Android/project.properties new file mode 100644 index 00000000..ce39f2d0 --- /dev/null +++ b/Android/project.properties @@ -0,0 +1,14 @@ +# This file is automatically generated by Android Tools. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must be checked in Version Control Systems. +# +# To customize properties used by the Ant build system edit +# "ant.properties", and override values to adapt the script to your +# project structure. +# +# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): +#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt + +# Project target. +target=android-18 diff --git a/Android/res/drawable-hdpi/ic_launcher.png b/Android/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..e4363d26 Binary files /dev/null and b/Android/res/drawable-hdpi/ic_launcher.png differ diff --git a/Android/res/drawable-ldpi/ic_launcher.png b/Android/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 00000000..d3d2d5ff Binary files /dev/null and b/Android/res/drawable-ldpi/ic_launcher.png differ diff --git a/Android/res/drawable-mdpi/ic_launcher.png b/Android/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..f15e588a Binary files /dev/null and b/Android/res/drawable-mdpi/ic_launcher.png differ diff --git a/Android/res/drawable-xhdpi/ic_launcher.png b/Android/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 00000000..b3a57ea4 Binary files /dev/null and b/Android/res/drawable-xhdpi/ic_launcher.png differ diff --git a/Android/res/drawable-xxhdpi/ic_launcher.png b/Android/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..5900a231 Binary files /dev/null and b/Android/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/Android/res/drawable-xxxhdpi/ic_launcher.png b/Android/res/drawable-xxxhdpi/ic_launcher.png new file mode 100644 index 00000000..e7efff83 Binary files /dev/null and b/Android/res/drawable-xxxhdpi/ic_launcher.png differ diff --git a/Android/res/layout/main.xml b/Android/res/layout/main.xml new file mode 100644 index 00000000..87705d85 --- /dev/null +++ b/Android/res/layout/main.xml @@ -0,0 +1,18 @@ + + + + + +