Integrating Twitter in an Android application -
i want simple example of implementing twitter in our application. prefer not browsable; should open on our application area only. after login user can post tweets on his/her account.
good question leaves room counter-questions :-)
i see @ least 2 ways walk down path (note don't know twitter or how it's used):
you synchronize twitter data ("tweets"?!?) on phone later viewing.
you view snapshot of current tweets on given channel , don't store (except user credentials).
as of first alternative you'd typically want synchronize sqlite database (perhaps custom content provider) on target data twitter channel on twitter web servers (you can read bit on public twitter api looks here).
this synchronization done background service on phone. actual gui not communicate service itself, rather read data (and from) local sqlite database. way gui wouldn't depend on network latency, data traffic or data availability web. depend on database connectivity on local target. make sure run service in separate thread. default run in main thread (aka "gui-thread").
you pass entry alarmmanager wake background service every , then; service cache twitter data in database , kill (to save resources).
the second alternative wouldn't necessary require database caching layer (however recommended rid of web dependencies in gui layer, database contain latest data, old data overwritten regardless if user have read or not).
in both alternatives you'd want store basic user info, user name , password. store these values in sqlite database or if want keep simple: in shared preferences infrastructure.
you need read , parse xml data web. reading , parsing done service layer (remember: run in separate thread avoid lagging ui or getting application not responding time-out).
Comments
Post a Comment