diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-02-19 12:46:46 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-02-19 12:46:46 +0200 |
commit | 12f987e88031c5cbd9ff6534b9279b11219510ac (patch) | |
tree | 7b9aab7bef51636e9118fc249bc204ef24a77f0d /src | |
parent | ed3bc6d2b40cfd8eeb931a0608a1a298bf23df20 (diff) |
jvm-android: implement getSharedPreferences
Diffstat (limited to 'src')
-rw-r--r-- | src/libjvm-android.c | 12 |
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")); +} |