How to create my own custom file type containing an image or an audio file

579 Views Asked by At

I want to find a way to save captured picture and recorded sound in custom file-type(s) then open them in my app. I don't want to other apps could open my files (for example gallery app don't open my pictures).

Is there any way to encode and decode my files in my app for example by writing a string at end of files.

Thanks

2

There are 2 best solutions below

0
On BEST ANSWER

There is no need for custom file types. If you save your files in Internal Storage, no other application can access them. You can also save files in the External Storage that are private, by calling getExternalFilesDir().

Details are here: http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

1
On

Use a file extension no one else uses, then use this answer to open all such files with your app.