Android Question Start data connection (3G/gprs)

Dario126

Member
Licensed User
Longtime User
This might be old question, but I have not find right answer by now. :(

My app uses one service which is active all the time (device is not going to sleep). But 3G data connection is automatically turned off after some time (controlled by device if no activity by user is done within cca 15 min).

My app invoke some web page (send/receive data) every minute, but connection is till closed after 15 min.

1) How can I lock connection not to close ?

or better

2) How can I reconnect to 3G from my app ?

o_O
 

Dario126

Member
Licensed User
Longtime User
Yes, I have tried also with PhoneWakeState, but it was same story. Disconnected from 3G automatically, and not reconnected while invoking.

Now I tried this library, and it works.. I can reconnect while needed .. That's ok solution, thank you Erel ..


Btw. just for info: command .TurnDataConnectionOn did not work until this is added to manifest: AddPermission (android.permission.CHANGE_NETWORK_STATE) .. and that was not visible on first post, or within library ..
 
Upvote 0
Top