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?
Long tap on any folder to encrypt it with password. You will get option to delete the master file automatically after encryption. Select it else you have to individually delete all the originals after encryption.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With