QuantumBadger/RedReader — pull request #184 by NoNeedToBail (2014-11-25 19:50:44+00:00)
Title: Notifications for new messages

This addresses issue #162.

In the onCreate function of MainActivity, I added a call to create an Android alarm that triggers every hour.

I created a BroadcastReceiver that receives the alarm and checks for new messages on Reddit. Once it receives them, it parses the received messages and compares the newest message to the newest message from the previous check (which is saved in system preferences storage). If the new one is different, then the user has received a new message and a notification is broadcast to the user.

When the user taps this notification, it starts the app and there is a check in MainActivity of the Intent created by the activity to find out whether it is from a new message notification. If so, the inbox is opened for the user to view the new message they received.

Finally, I added a setting to enable/disable notifications, and I used Google Translate to provide translations of the setting's name.