Hi, On Tue, Jul 19, 2011 at 4:59 AM, shahbhat <[email protected]> wrote:
> I am moving an iPhone app to Android, where the iPhone app displayed > updated stock quote values continuously. I used background timers that > polled stock quote values and published them as events to all active > controllers. So I need some design suggestions: > > * Should I use local services for background polling task? As, this > service needs to be continuously running so I assume it should be non- > sticky service. > *You can have a "Handler" inside a thread of your app.. This will do the polling for you. Refer this link for more info on Handler: http://developer.android.com/reference/android/os/Handler.html* > * What is best way to publish events? Should I use > NotificationManager or Broadcast receivers? > *I would suggest using Intents.. Not sure how would you 'publish' events using broadcast 'receivers'..* * I would like the service to be started when the app starts and run > as long as the app is running. Is there a way to declare this in > AndroidManifest.xml as the examples of local service seem to start the > service from activity. > * Also, there is no direct interaction between activities and > services other than events. > > *AFAIK, Intents are the only means of communication... * Thanks in advance. > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- Regards Durgadoss -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

