Question

I recently try twitter app on Android-based phone ( HTC HD Desire , I guest). With twitter app, when I try to 'tweet' a message, my twitter app on the phone notify the change nearly in real-time.

I did some search and found out I could get "message" from Twitter in JSON format, but is that true that my app on android phone must have a separate thread running in the background to get information from server in some kind of format ( like JSON ..) than update my wall on the phone ??

If this really happened, I think it would be a disaster for my phone because it's should have run out of battery very soon.

Is there anyway to get the same result but not having a thread run in background to do the checking-updating work ?

Was it helpful?

Solution

If you want the updates to come through in real time, you'll have a Service running in the background that's constantly polling.

Alternatively you could put the heavy lifting to server side and implement a push mechanism. Upside, better battery life for your client. Downside, you have to pay money for infrastructure that will poll twitter, then push to clients.

OTHER TIPS

Do you want this information for writing your own application, or for finding out how the existing app you use works?

If it is about the latter, have you considered asking the app developer about the details on this? I am sure they could answer how much the application is polling, or if some sort of push mechanism is used. That answer might be more helpful than the guesswork that stackoverflowers can do for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top