summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libjvm-android.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libjvm-android.c b/src/libjvm-android.c
index baaf614..e633347 100644
--- a/src/libjvm-android.c
+++ b/src/libjvm-android.c
@@ -1,3 +1,5 @@
+#include <stdarg.h>
+#include <stdio.h>
#include <assert.h>
#include "jvm/jni.h"
@@ -7,3 +9,13 @@ android_content_Context_getPackageName(JNIEnv *env, jobject object, va_list args
assert(env && object);
return (*env)->NewStringUTF(env, "com.gnu.linux");
}
+
+jobject
+android_content_Context_getSharedPreferences(JNIEnv *env, jobject object, va_list args)
+{
+ assert(env && object);
+ jstring str = va_arg(args, jstring);
+ printf("%s::%d\n", (*env)->GetStringUTFChars(env, str, NULL), va_arg(args, jint));
+ va_end(args);
+ return (*env)->AllocObject(env, (*env)->FindClass(env, "android/content/SharedPreferences"));
+}