Hi allI'm trying open a file in res/raw from native code - NativeActivity.Here is a section of code:jmethodID getResourcesId = env->GetMethodID(contextClass, "getResources","()Landroid/content/res/Resources;");jobject resourcesObj = env->CallObjectMethod(app->activity->clazz,getResourcesId);jclass resourcesCls = env->FindClass("android/content/res/Resources");if (!resourcesCls) {__android_log_print(ANDROID_LOG_ERROR, "AccessingApkFiles","Can't find android/content/res/Resources");} else {jmethodID getOpenRawResId = env->GetMethodID(resourcesCls,"openRawResourceFd", "(I)Landroid/content/res/AssetFileDescriptor;");if (getOpenRawResId) {__android_log_print(ANDROID_LOG_WARN, "AccessingApkFiles","-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-");jobject assetFileDescriptorObj = env->CallObjectMethod(resourcesCls,getOpenRawResId, "R/res/raw");} else__android_log_print(ANDROID_LOG_ERROR, "AccessingApkFiles","Can't get method ID for openRawResourceFd");}When the bold section of code is executed I get the following error:W/dalvikvm(6979): JNI WARNING: can't call Landroid/content/res/Resources;.openRawResourceFd on instance of Ljava/lang/Class;
I think the problem is with the resource identifier that needs to be passed the Resource object.How do you pass the resource identifier to the method. Java is R.res.raw but for native code?Thanks--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.