Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is the file when use getCacheDir

Tags:

android

As I debugged, I found that the GetCacheDir return /data/data/yourapp/cache/

But as I store files, I found nothing in that path(with shell), but in /sdcard/Android/data/yourapp/cache/ I found the cache file? who can tell me why?

like image 946
landry Avatar asked Feb 10 '11 12:02

landry


1 Answers

As I debugged, I found that the GetCacheDir return /data/data/yourapp/cache/

That sounds right for getCacheDir.

But as I store files, I found nothing in that path(with shell), but in /sdcard/Android/data/yourapp/cache/ I found the cache file? who can tell me why?

That's what you'd get from getExternalCacheDir.

Are you sure you're using the right API call? Did you check the return values of your File operations (are they all successful)? You could try some File functions to check that things are working right. (createNewFile, exists, getAbsolutePath)

like image 157
idbrii Avatar answered Sep 22 '22 00:09

idbrii