开发者

Temp folder in android

开发者 https://www.devze.com 2023-01-16 02:51 出处:网络
I am porting a c++ library code into android(which was initially written for linux). The library is built and is used by a java application.

I am porting a c++ library code into android(which was initially written for linux).

The library is built and is used by a java application.

In the previous linux code, library used to create and update a log file in /tmp folder of the system... But unfortunately, there is no such temp dir in android.

Seems I cannot use use applications cache to save the file due to a few reasons.

1. User need to view the file after exiting the app

2. The library need to be reused by diff开发者_运维技巧erent applications in future. 

3. The log file is created by the native library(and not the java app)

(pls correct me if some/all of my understanding is wrong)

Also I found most of the directories are write protected in the default setting..

How can i tackle the issue, without 'rooting' the os? Pls help..


Modify the C/C++ code to use a directory supplied from the Java code. Have the Java code pass in some subdirectory you create under Environment.getExternalStorageDirectory().

0

精彩评论

暂无评论...
验证码 换一张
取 消