文件操作的Android在NDK [英] File Operations in Android NDK
本文介绍了文件操作的Android在NDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用了Android NDK,使主要用C出于性能原因的应用程序,但作为的fopen没有在Android中正常工作,似乎等文件操作。每当我尝试使用这些功能,应用程序崩溃。
I am using the Android NDK to make an application primarily in C for performance reasons, but it appears that file operations such as fopen do not work correctly in Android. Whenever I try to use these functions, the application crashes.
如何创建/写入与Android NDK的文件?
How do I create/write to a file with the Android NDK?
推荐答案
以上全部是正确的。您可以使用文件和打开的fopen通过NDK的文件。
但是...不要忘了放置权限了。
在Android清单地方
All of the above is correct. You can open a file through the NDK using FILE and fopen. BUT... Dont forget to place a permission for it. in the Android manifest place a
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
这篇关于文件操作的Android在NDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文