I'm going to contribute very unorthodox two cents on this.

The original poster wrote that his app does this:


1. I parsing XML in android which is hosted on server (same like RSS feed).
2. It takes around 10 second depend on network speed.
3. XML refresh on server in every 15 minutes.

This is actually not that bad. Should take only about 1-3% of the total battery usage, and that's at night, when the screen does not consume power, and maybe even less (based on my tests with a similar scenario). With compression for slow links, might take less.

While I agree that C2D really is a great alternative to polling, and is architecturally the right thing to do, it takes some effort to set up and maintain. Doing the obvious and much easier thing might be.... more obvious and easier :)

So my recommendation would be to test and measure: leave the service running overnight, and look at battery stats in the morning. That should tell if there really is a problem that needs fixing.

-- Kostya

31.01.2011 15:49, Federico Paolinelli пишет:
Please note also that c2dm is proposed as a notification of new data available on the server (or at least, it is what I understood :-) ). There is a size limit of the data that can be bundled in the message. The c2d message should only trigger your app to start the fetching (and I wouldn't rely entirely on it, setting a coarser fetching interval).

Hope this may help.

Federico
--
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


--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com

--
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

Reply via email to