开发者

How to install a file under data/data/myapp/files folder?

开发者 https://www.devze.com 2023-02-25 12:44 出处:网络
I tried to put my file, say like, index.html under assets, but it was converted to a raw binary file with unreadable file name, however, I wanted to have that index.ht开发者_运维问答ml intact deployed

I tried to put my file, say like, index.html under assets, but it was converted to a raw binary file with unreadable file name, however, I wanted to have that index.ht开发者_运维问答ml intact deployed under app/files folder, what should I do?

Thanks.


Step #1: Create a File object via new File(getFilesDir(), "index.html")

Step #2: See if the File exists using exists()

Step #3: If the File does not exist, copy it from your assets using standard Java I/O

0

精彩评论

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