Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
376 views
in Technique[技术] by (71.8m points)

How to make a file hidden in android sd card?

I am creating android application which contains DB that needs to be hidden(not able to access by the user)in the SD Card. Can anyone tell me how to do this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Any file stored on the SD card is accessible both by applications running on the phone, and by users who have mounted the SD card (both while it's in the phone and otherwise).

You can change the file properties to make it 'hidden', but it will still be easily found. There is no way to make a file on a public partition like an SD Card 'secure' in the manner you describe - users will always be able to copy, delete, and potentially change the file.

The best solution to your problem is to look into ways to encrypt your database to record it securely. You won't be able to prevent users from deleting or copying the file, but you should be able to make it difficult for them to read data from it or modify its contents.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...