Android Programming Tutorials

(Romina) #1
Listening To Your Friends

Finally, return that binder from onBind():


@Override
public IBinder onBind(Intent intent) {
return(binder);
}

Of course, this API does not do much, but we will expand it shortly.


At this point, you can compile your project, but it will not run properly,


because we have not provided account information to the JTwitter API.


That is fine for now, as we will correct that flaw in the next tutorial.


Extra Credit................................................................................................


Here are some things you can try beyond those step-by-step instructions:



  • Add a preference for the timeline polling period. Use that polling


period in the service, including changing the polling period when
the preference changes.

Further Reading.........................................................................................


You can learn more about the roles of services and how to create them in


the "Creating a Service" chapter of The Busy Coder's Guide to Android


Development.


182
Free download pdf