Best Practice when Caching files in Android

前端 未结 3 1058
执念已碎
执念已碎 2021-01-30 02:42

I currently have my app caching image files in the cache sub-directory for the application. The images are used in a ListView and stored in a Has

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 03:09

    Should I include an option to choose the location of the cache?

    IMO: No, let make it more simplest as possible (Except you can include advance setting for expert user)

    Should I attempt to manage the size of my cache (be it in the /cache or /sdcard) or just forget about it?

    IMO: This is optional, it is double sword: your more work on background will help user more convenience but also more bug prone

    Use 3rd libs: IMO using 3rd library as Picasso is better, it handle cache automatically by order: Memory cache -> Disk cache -> Network

提交回复
热议问题