Hello Dianne, Speaking of clearing the application's cache data...what is the difference in deleting the cache when the application exits as opposed to clearing the cache data by the user himself? I have 2 use-cases:
1. When the application exits gracefully, I should be able to clean all the data that i had created/stored during the lifetime of the application. 2. When the application crashes unexpectedly, or due to an abnormal event, the data should not hang on forever. (I believe this is taken care of by the framework ? ) Thanks On Sun, Jul 26, 2009 at 4:29 AM, Dianne Hackborn <[email protected]>wrote: > You generally shouldn't need to clear it, since the point of that is it > allows the system to delete those files to free up storage when needed. > > That said, you do want to keep the amount of data in your cache at a > reasonable size rather than just throwing stuff in there and letting it grow > indefinitely. The system should eventually get around to deleting your old > files, but everyone is happier if the app is keeping that under control. > This is not the same as deleting when your app "exits" though. > > On Sat, Jul 25, 2009 at 3:14 PM, niko001 < > [email protected]> wrote: > >> >> Hi Mark, >> >> thanks for your answer. >> >> I mean the cache that the users can delete themselves by going to >> Settings --> Apps --> Manage Apps --> "My App" --> Clear Cache >> >> Thanks for your suggestion, I'll try it! >> >> Niko >> >> >> On Jul 25, 2:27 am, Mark Murphy <[email protected]> wrote: >> > niko001 wrote: >> > > is it possible to force thecacheof your app to clear when the user >> > > exits the app? >> > >> > > My app piles upcachedata (rightfully so) on each start, which is no >> > > longer needed once the user quits the app, so I am trying to find a >> > > way to forcibly clear it. >> > >> > You could try deleting the files from getCacheDir(), available on >> > Activity, Service, and other flavors of Context. >> > >> > On the other hand, you did not specify whichcacheyou were concerned >> > about... >> > >> > -- >> > Mark Murphy (a Commons Guy)http://commonsware.com| >> http://twitter.com/commonsguy >> > >> > _The Busy Coder's Guide to *Advanced* Android Development_ >> > Version 1.0 Available! >> >> > > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

