On Mon, Jul 12, 2010 at 7:30 AM, Samuh <[email protected]> wrote:
> 1. Is this the right way to approach the problem?

>From the limited amount of information you have supplied, it seems
like a reasonable choice, so long as your BroadcastReceiver routes
control to an IntentService to do the actual network I/O.

> 2. Is AlarmManager reliable? Would it remember Alarms after a device
> boot? (I think it does)

No, you have to re-create your alarm schedule on a reboot.

> 3. How do I ensure that battery usage is kept at minimum.(I have heard
> something about using "keep-alive" to sustain the session for longer
> time..what is this legend?)

Do not poll very frequently. Use setInexactRepeating() if possible so
your work and work from other interested parties can be done at the
same time, so the device wakes up once.

> 4. What are other things that I need to consider? I am sure I must be
> missing lots of things here.

If your alarms will be waking up the device, you need to arrange for
the device to stay awake while you are doing your network I/O. See:

http://github.com/commonsguy/cwac-wakeful

Be careful of connectivity changes. If you woke up the device, WiFi
will be off, and so if you try to access the Internet immediately, you
will probably wind up with 3G (or whatever other cellular data the
device uses). It is possible that your polling operation will be
interrupted by WiFi turning on. I have not run experiments in this
area yet myself, but based on errors I see with the Android Market
client and StreamFurious Pro, that is my interpretation of what is
going on.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android App Developer Books: http://commonsware.com/books

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