1

I just want to ask you if you anyone knows how to change the Setting available in:

Settings->Wireless Settings->Mobile Network from code or

Setting: Settings->Wireless Settings->Mobile Network Settings->Network
operators->Select Automatically?

I had been unable to find a property that match this setting in the

Settings.System / Settings.Secure classes.

Is there any alternative way to "turn on/off" the MOBILE connectivity ?

The reason I need to solve this is to workaround the bug occur during transitioning from WIFI to MOBILE that do not enable CELL data automatically.

tchrist
  • 78,834
  • 30
  • 123
  • 180

1 Answers1

1

I think support for this sort of thing(changing settings from code) was removed/deprecated in the newer versions of the SDK; it is not advisable. What I've said is based on Dan Morill's Blog titled: Future Proofing your Android Apps

Eitherways, generally, you would write:

Settings.System.putString(getContentResolver(), <Settings.System.CONST>, <value>);

and have the following permission in your maifest: android.permission.WRITE_SETTINGS The List of Settings.System.CONST can be found in the official documentation: see here

Samuh
  • 36,316
  • 26
  • 109
  • 116