About
Contents
STL
Android
Eigen
enchant.js
Firefox OS
OpenGL
OpenGL ES 2.0
pukiwiki
UE4
Unity
Windows Phone
Xamarin
Materials Link
その他
PR
STL
Android
Eigen
enchant.js
Firefox OS
OpenGL
OpenGL ES 2.0
pukiwiki
UE4
Unity
Windows Phone
Xamarin
NDKを利用してネイティブコードから本体SDカードのパスを取得します。
static string GetInternalDataPath() { jclass cls_Env = env->FindClass( "android/app/NativeActivity" ); jmethodID mid_getExtStorage = env->GetMethodID( cls_Env, "getFilesDir","()Ljava/io/File;" ); jobject obj_File = env->CallObjectMethod( g_androidApp->activity->clazz, mid_getExtStorage ); jclass cls_File = env->FindClass( "java/io/File" ); jmethodID mid_getPath = env->GetMethodID( cls_File, "getPath", "()Ljava/lang/String;" ); jstring obj_Path = (jstring)env->CallObjectMethod(obj_File, mid_getPath); const char* path = env->GetStringUTFChars(obj_Path, NULL); eaPath = path; env->ReleaseStringUTFChars(obj_Path, path); return eaPath; }