Android Question How can I force reactivation of Connectivity event after a deep sleep...

tigrot

Well-Known Member
Licensed User
Longtime User
Hi everybody
I need to know network connection quality before starting an activity with heavy data exchange. I trap Connectivity change and keep the state, but in case I check it after a "deep sleep" of the device the state is sometimes GPRS or less. This doesn't happen if the device is on charge for the whole night. I memorize the changes of the network state in the Connectivity change event.
What I think is that the App doesn't receive the event Connectivity changes no more. The customer informed me that after the night he checked mail and the Internet was working, but my App still believed it had no internet connection. The event is handled by a foreground service.
This is the only issue of this kind that testers signaled to me. It' a NGM with 4.2 onboard. Maybe a OS issue?
Thank you for your time!
Regards
Mauro
 

tigrot

Well-Known Member
Licensed User
Longtime User
Thank you for kind support. I jave already put on the group a library i wrote yesterday to test the kind of connection to the network. It works with a single method and gives back "WIFI" in case of local network or "GPRS", "EDGE" or any other mode in case of public network!
Have a nice Sunday.
Mauro
 
Upvote 0

bgsoft

Well-Known Member
Licensed User
Longtime User
Hi Mauro

The event is handled by a foreground service.

If the event is in the foreground, on a guess that this Activity, so that when the device is turned off, the application will Pause and not the event runs.
Pass it to a Service Module and work

I have answered you in your Italian forum and I have made a small example

greetings
 
Upvote 0
Top