GetFilesDir() from NDK?

前端 未结 2 1448
盖世英雄少女心
盖世英雄少女心 2020-12-07 01:08

Is there a way to get the application\'s directory to save private data to a file for my application directly from the NDK? In other words, I need an equivalent of the Java

2条回答
  •  没有蜡笔的小新
    2020-12-07 01:29

    I have custom helper class for accessing various paths, for the data directory I do this:

    1. Read /proc/self/cmdline or /proc/**MyPID**/cmdline
    2. Append the results from #1 to /data/data/

    Example results:

    /data/data/com.yourcompany.yourproduct/
    

提交回复
热议问题