I am writing audio data as in amr file format in sdcard.
File file = new File(dir, "test.amr");
try {
FileOutputStream f = new FileOutputStream(file);
f.write(audioData);
f.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException ex) {
ex.printStackTrace();
}
Its working properly but my problem is it shows in other applications as well like in default media player of android OS.
My question is how can write a file on sdcard which is only accessible to my application.Not to other applications on device.
Thanks.
That’s not possible, all files on SD card are accessible to all apps.
To keep files private, create them in application’s local directory.
Location of app’s private folder is determined by:
Other option: make empty “.nomedia” file in your folder on SD card, then files inside won’t (should not) show in media players.