You can use the Android cache directory, which is usually located in / Android / data / YOURPACKAGENAME / cache
Use this code to get this path.
final String cachePath = Environment.MEDIA_MOUNTED.equals (Environment.getExternalStorageState ()) || ! isExternalStorageRemovable ()? getExternalCacheDir (context) .getPath ():. Context.getCacheDir () GetPath ();
Displaying bitmaps efficiently; check out this example provided by Google, very useful if your goal is to cache images from the Internet. However, it is displayed to the user and can be easily removed.
If you want to hide these files from the user, you can simply save the files without any path, it will be inside data / data / YOURPACKAGENAME, which is hidden from users until the user gets root access. Example
String FILENAME = "hello_file"; String string = "hello world!";
FileOutputStream fos = openFileOutput(FILENAME, Context.MODE_PRIVATE); fos.write(string.getBytes()); fos.close();
Storage options
Minas source share