Problems with Toggle Library (TurnDataConnectionOn, TurnDataConnectionOff)

bgsoft

Well-Known Member
Licensed User
Longtime User
Hello:

I created a program that among other things started and for the mobile data connection.

I have used TurnDataConnectionOn and TurnDataConnectionOff and does not work, I've also tried ToggleDataConnection and neither works.
Do not think it's an initialization problem, and I use the same Wi-Fi and Bluetooth library and if it works. Although it does not work with GPS (TurnGPSOff, TurnGPSOn).
This I have tested on these phones and none works:

Y Samsung GT-S 5363 Android Version 2.3.6
Samsung Galaxy 2 GT-I9100 Android Version 4.1.2
LG Optimus 2X Android Version 2.3.1.4

Someone could give me a solution or tell me that other libraries could start and stop the data connection?

thanks

Jesus

It's my first query and do not know if this is the right place, sorry in advance.
 

bgsoft

Well-Known Member
Licensed User
Longtime User
Solved

vampirbcn (Spanish Forum), said that adding this to the manifest:

AddPermission (android.permission.CHANGE_NETWORK_ST ATE)

and it works TurnDataConnectionOff / TurnDataConnectionOn :).
Now I need to do the same with the GPS

thanks

:sign0013: for my bad English
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
vampirbcn (Spanish Forum), said that adding this to the manifest:

AddPermission (android.permission.CHANGE_NETWORK_ST ATE)

and it works TurnDataConnectionOff / TurnDataConnectionOn :).
Now I need to do the same with the GPS

thanks

:sign0013: for my bad English

With JellyBean, you cannot activate/deactivate the GPS by code. Same thing for the Airplane mode. Google is enforcing its security policy.
 
Upvote 0
Top