I’m New to android, and I’m creating an application that uses the twitter api, and store in an array of strings to list of my twitters.
I need to create a service that will be running in the background, and every time I connect to internet it to update my array of strings and call my brodcast for notification.
Anyone know how to do? perhaps an example?
Define “run in background”? Run indefinitely off the UI thread, wait for a request to connect to the Internet and then reply?
Use an IntentService. Send it an Intent when you want to connect. Use LocalBroadcastReceiver to send an Intent back to your Activity.