From 12f987e88031c5cbd9ff6534b9279b11219510ac Mon Sep 17 00:00:00 2001 From: Jari Vetoniemi Date: Mon, 19 Feb 2018 12:46:46 +0200 Subject: jvm-android: implement getSharedPreferences --- src/libjvm-android.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') 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 +#include #include #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")); +} -- cgit v1.2.3-70-g09d2