/Michael
> --
> You received this message because you are subscribed to the Google Groups
> "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to
> android-ndk...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/android-ndk?hl=en.
>
>
Actually I found why.... I was copying the library from the assets folder. I have several libraries there, and copyed the wrong one. I guess one should never overlook the obvious....
Thanks,
Rodney
Hardcoded, into the /data/data/mypackage/files folder;
Rodney
Rodney, If you find a way, pls let me know....
/Michael
I would, but currently I have a completely native app that doesn't have any Java in it. I think I will try grabbing access to that method from the native side.
Rodney
I am doing the following to grab access to my internal and external
storage areas:
status = vm->GetEnv((void **) &jni_env, JNI_VERSION_1_4);
if(status < 0) {
LOGE("callback_handler: failed to get JNI environment, ""assuming
native thread");
status = vm->AttachCurrentThread(&jni_env, NULL);
if(status < 0) {
LOGE("callback_handler: failed to attach ""current thread");
return;
}
}
cls_Env = jni_env->FindClass("android/app/NativeActivity");
mid_getExtStorage = jni_env->GetMethodID(cls_Env, "getFilesDir",
"()Ljava/io/File;");
obj_File = jni_env->CallObjectMethod( state->activity->clazz,
mid_getExtStorage);
cls_File = jni_env->FindClass("java/io/File");
mid_getPath = jni_env->GetMethodID(cls_File, "getPath",
"()Ljava/lang/String;");
obj_Path = (jstring) jni_env->CallObjectMethod(obj_File, mid_getPath);
path = jni_env->GetStringUTFChars(obj_Path, &stringgot);
LOGI("INTERNAL PATH = %s\n", path);
internal_path = strdup(path);
copy_libs(state->activity->assetManager, internal_path);
jni_env->ReleaseStringUTFChars(obj_Path, path);
mid_getExtStorage = jni_env->GetMethodID( cls_Env,
"getExternalFilesDir", "(Ljava/lang/String;)Ljava/io/File;");
obj_File = jni_env->CallObjectMethod(state->activity->clazz,
mid_getExtStorage, NULL);
cls_File = jni_env->FindClass("java/io/File");
mid_getPath = jni_env->GetMethodID(cls_File, "getPath",
"()Ljava/lang/String;");
obj_Path = (jstring) jni_env->CallObjectMethod(obj_File, mid_getPath);
path = jni_env->GetStringUTFChars(obj_Path, &stringgot);
LOGI("EXTERNAL PATH = %s\n", path);
external_path = strdup(path);
Now I can store my libs in my assets dir and move them from there.
The only problem I have now is trying to break things up in to
subdirectories. The native AAssetDir can read filenames, but not
directories.
Thanks,
Rodney