Java Is the Language of Possibilities Java is powering the innovation behind our digital world. Harness this potential with Java resources for student coders, hobbyists, developers, and IT leaders.
Shared Libraryを作成するとき、 インスタンスの管理はなかなか悩ましい問題ですが、 Androidのmediaパッケージで、 JNIを利用したちょっと変わったインスタンス管理をやっていたので紹介&覚書。 /* envはJNIEnv*, thizはjobjectで、JNI呼び出しクラスのインスタンス */ /* NativeClassはAndroidミドル側の適当なクラス */ jclazz clazz = env->FindClass("hoge/foo/JavaClass"); jfieldID context = env->GetFieldID(clazz, "mNativeContext", "I"); NativeClass* pNative = new NativeClass; env->SetIntField(thiz, context, (int)pNative)
Is there any way in which I can pass/get an object of android context in my ndk appliation. I want to use SharedPreferences in my ndk application via jni interface. To get an instance of SharedPreferences object, I need to call getSharedPreferences() on Context object. But I do not have access to the context object. OR How can I read and write an xml file from NDK ? Any pointers will be appreciate
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く