Problem description:
--------------------
In my android App, I experience connectitity issues when doing a
remote HTTP
("polling") call from an AsyncTask that was started after an alarm
went off.

The lookup works very well when the standard Android setting "Enable
always-on
mobile data (Settings -> Wireless & networks -> Mobile networks) is
turned
to "on".

Solution that works: alarm goes of, Android "Service" receives an
alarm intent,
starts a background thread (AsyncTask). The new thread acquires a
partial wake
lock, establishes the connection (polling), notifies the user and
releases the
wake lock.

So far, so good. The issue is that, when always-on is turned "off",
the polling fails most of the time if
the phone was in standby for a while (> 30 min).

Since the polling thread sends a notification, I directly get feedback
on the
unsuccessful polling attempt.

Motivation:
-----------
A lot of users turn of "always-on" to reduce battery drain. So, it's
likely
that an app users run into issues. I want to handle or prevent the
"errors" that users will face.

Solution attempts:
------------------
I have experimented a lot without any major break-through:

- multiple retries and intermediate sleeps to give the phone some time
to establish the connection
- http parameters (timeouts, etc.)
- different HttpClient (Apache)

Questions:
---------
- What excactly does the setting "always-on" mean and what do
developers have to regard?
- I am wondering if it is generally possible to implement an alarm-
based polling mechanism that is able to establish a data connection
even if "always-on" is
turned "off".
- Are there any alternative solutions (no C2DM possible)?

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