开发者

History and bookmark feature in Android application

开发者 https://www.devze.com 2023-03-27 20:31 出处:网络
In my app, I want to add history and add to favorites features. It\'s an offline app of book details, hence I need to see which book detail was recently viewed a开发者_开发技巧nd save it to database.

In my app, I want to add history and add to favorites features. It's an offline app of book details, hence I need to see which book detail was recently viewed a开发者_开发技巧nd save it to database. How to do that?


  1. First of all have a rough estimate of the number of records you want ( history depth, favorites depth ).

  2. How do you plan to reference a detail. Will a detail consist of multiple pages and do you want the addressability ( if there is such a word ) to the page level - OR - do you want to maintain a history of details.

  3. If all you are saving is a DetailID etc, you may even just use SharedPreferences, rather than using the database.

  4. You could use the lifecycle events like onCreate, onResume, onPause etc to track loading / unloading of details.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号