jeudi 25 juin 2015

Android Notifications when new article pulled from SQLite database?

I've looked as best I could and could not find someone with a similar problem so I'll be asking here. My application uses an IntentService and AlarmManager to parse JSON and enter articles into a database of tables, each table displayed in respective fragments in ListViews based on category. My application polls for updates every 15 minutes using the AlarmManager, so I was wondering what the logic would be for "if new article" considering the database is updated with stories I would not be able to compare the first item in the table with the first item in an "old table" since it is overwritten.

Currently my application just sends a notification when my AlarmReceiver's onReceive method is called after starting the service to parse the json and write the information to the database, so I just need to modify it so that the notification fires only when the condition is met that "new content is available", can anyone explain that logic in this context?

Aucun commentaire:

Enregistrer un commentaire