jclass envClz = (*env)->FindClass(env, "android/os/Environment");
jmethodID getExternalStorageDirectory = (*env)->GetStaticMethodID(env, envClz,
"getExternalStorageDirectory",
"()Ljava/io/File;");
jobject jobject1 = (*env)->CallStaticObjectMethod(env, envClz, getExternalStorageDirectory);
jmethodID getAbsolutePath = (*env)->GetMethodID(env, (*env)->FindClass(env, "java/io/File"),
"getAbsolutePath",
"()Ljava/lang/String;");
jstring jstring1 = (*env)->CallObjectMethod(env, jobject1, getAbsolutePath);
const char *path_utf = (*env)->GetStringUTFChars(env, jstring1, NULL);
LOGE("%s", path_utf);
(*env)->ReleaseStringUTFChars(env, jstring1, path_utf);
来源:CSDN
作者:fjal256
链接:https://blog.csdn.net/fjal256/article/details/80600336