tags:

views:

41

answers:

1

I am creating an widget application and would like to send random "words of encouragement" to the user. Something like positive affirmations would appear in the notification area, but not due to a user action, but rather a random action internal. I would grab a "words of encouragement" randomly from a database full of quotes.

Not sure how clear this is, but if it is to someone and they can point me in the right direction...greatly appreciated.

A: 

Why don't you create the Service? You need no GUI to initiate notification creation. So, my suggestions:

  • from appWidgetProvider start Service
  • On Service start create Handler that will periodically (or with some variation) trigger
  • When Handler triggers, pick random record from SQLite database (previously filled with many "words of encouragement") and send Notification
  • Create some criterion that will call stopSelf() in the service
Desiderio
what are you considering my startup Activity? I want this to start when I load my widget so I have an appWidgetConfigure and an appWidgetProvider.
taraloca
You are right, edited the answer.
Desiderio