March 2013
Beginner to intermediate
580 pages
16h 11m
English
Your service will be polling for new results, so it will need to know what the last result fetched was. This is a perfect job for another SharedPreferences entry. Add another constant to FlickrFetchr to store the ID of the most recently fetched photo.
Listing 29.6 Add recent ID preference constant (FlickrFetchr.java)
public class FlickrFetchr {
public static final String TAG = "PhotoFetcher";
public static final String PREF_SEARCH_QUERY = "searchQuery";
public static final String PREF_LAST_RESULT_ID = "lastResultId";
private static final String ENDPOINT = "http://api.flickr.com/services/rest/";
private static final String API_KEY = "xxx";
...
The next step is to fill out your service. Here is what you need to do:
Pull ...
Read now
Unlock full access