On Thu, Jun 30, 2011 at 8:46 AM, Sapna Srivastav <[email protected]> wrote: > I need some help. In application,I need a service. > The scenario is like this, my application runs after a specied time > laps or interval as set by user through an alarm manager and do some > recording of GPS and store upto 10 location and send to the server. > But some time connection to server takes a long due to server > congestion and my application goes to ANR state. To avoid ANR I need a > service class for location updation to the server from broadcast > receiver and notify the completion of service to the broad cast > receiver when result is OK from the server. > > Please suggest me how can I accomplish this task. > > The main question is how to notify the broad cast reciver that service > has completed its task?
You don't. Your BroadcastReceiver calls startService() on the Service. Your Service does the work. It does not "notify the completion of service to the broad cast receiver", because that BroadcastReceiver object has been gone for quite a long time. Rather, the Service does *all of the work*, including whatever you would expect the BroadcastReceiver to have done after "notify the completion of service". -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to *Advanced* Android Development_ Version 1.9.9 Available! -- 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

