且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android的NDK数据保存/载入

更新时间:2023-02-02 21:57:29

您仍然可以使用文件stdio.h在NDK项目。 #包括和英镑走。

You can still use stdio.h in an NDK project. #include and pound away.

唯一的技巧越来越路径到您的应用程序的私有数据文件夹。它可以作为语句>活动 - GT&; internalDataPath android_main 。这条道路外,该应用程序有没有文件系统权限。

The only trick is getting the path to your application's private data folder. It's available as state->activity->internalDataPath in android_main. Outside of that path, the app has no filesystem rights.

您可能会需要你的的JNIEnv 最终这种或那种方式。的Java API的全部未镜像为天然子系统;因此要坚持到 ENV 。不过,本地文件I / O是在那里。

You will probably need your JNIEnv eventually one way or another. The entirety of Java API is not mirrored for the native subsystem; so hold on to that env. But native file I/O is right there.