I want to save some cache data for my appliaction. I used to do this by saving the data in the external storage and this worked fine. But I want my device to show my cache size in the app settings but It doesn´t. I guess this is because I save the data in external storage. What I want is that my data still exists aufter closing the app or even swichen off my device. Now I tried to save my files in the internal storage but I have troubles reading the files + the cache size is still wrong in settings. Can anyone give me the methodes do write and read strings into files in the applications cache please?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
I think everything is clearly explained here... :)
if you have juste simple data, you can use SharedPreferences like this for example :
in order to use the cache, you have to use the method
which return a File object you can write and read on.
Use this to write :
Be aware that Android may delete this file if the system lack space, so don't use this to store too much data. ( > 1MB)