Implementing the caching logic to POIApp
The DBManager
class is now tested and ready to use straightaway on POIApp
. The POIApp
will save the POI records when the download is completed, and the list will be retrieved later when the app is unable to fetch the updated list from the server. Perform the following steps to integrate the DBManager
class with POIApp
:
- Call the
CreateTable()
method on thePOIListActivity
class to initiate the database:DBManager.Instance.CreateTable();
- Open the
POIListFragment
class and go to theDownloadPoisListAsync()
method. We have used this method to download the POI list from the server. The following updates are required here:- Clear the database cache when the POI downloads from the server are successful.
- Save the newly ...
Get Xamarin Mobile Application Development for Android - Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.