Reputation: 17
I want to create a local blob storage system where I can upload files, and they will be stored in a location inaccessible to file pickers and the gallery—only my app should have access to them.
I initially tried using SQLite to store the files, but it didn’t work as expected. Ideally, I need a solution that ensures:
What would be the best approach to achieve this? Are there any specific databases, file storage mechanisms, or encryption techniques I should consider?
Any guidance or code examples would be greatly appreciated!
Upvotes: 0
Views: 17
Reputation: 147
Files stored in internal storage (context.getFilesDir()) are only accessible to your app by default. Other apps (including file explorers and media pickers) cannot access them.
File file = new File(context.getFilesDir(), "secure_blob.dat");
FileOutputStream fos = new FileOutputStream(file);
fos.write(fileData);
fos.close();
Upvotes: 0