Description of the problem:
In my Android application, I am experiencing connection problems with the remote HTTP protocol ("polling") from AsyncTask, which was launched after the alarm went off.
The search works very well when the standard Android installation “Enable always turned on mobile data” (Settings → Wireless and networks → Mobile networks) to “on” .
Solution that works: alarm, Android "Service" receives the intent of the alarm, starts the background thread (AsyncTask). The new thread receives a partial trace lock, establishes a connection (polling), notifies the user and releases the trace lock.
So far so good. The problem is that when it is always turned off, “off” , polling does not take place most of the time if the phone has been in standby mode for some time (> 30 minutes).
Since the polling stream sends a notification, I directly receive feedback on a failed polling attempt.
Motivation:
Many users turn "always on" to reduce battery drain. Thus, it is likely that application users are facing problems. I want to handle or prevent the "errors" that users encounter.
Decision:
I experimented a lot without any major breakthroughs:
- several attempts and intermediate dreams to give the phone some time to establish a connection.
- http parameters (timeouts, etc.).
- another HttpClient (Apache)
Questions:
- What does it mean , the value of the parameter "always-on" means and what should developers consider?
- I wonder if it is possible implement an interrogation mechanism based on an alarm that can establish a data connection, even if it is "always on" off.
- ( C2DM)?
:
, Android " ". , , , .