在Android库上缓存

时间:2014-02-07 19:29:44

标签: android caching android-resources android-context

我正在编写一个Android库,将在多个应用程序中使用。

如何找到库的External Cache Dir。据我所知,库没有如何获取上下文应用程序。

1 个答案:

答案 0 :(得分:0)

让托管您的库的应用程序在File对象中传递,以便存储缓存文件的位置。

或者,托管您图书馆的应用程序会在Context对象中传递,您可以从中调用getCacheDir()getExternalCacheDir()

库没有缓存目录。应用程序有缓存目录。