Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change network selection mode programmatically

I'm trying (wondering if it's even possible) to write an app, that would change the network selection mode automatically, based on some criteria. E.g. change the network operator from Vodafone to T-Mobile (assuming that the SIM card registration will succeed, but I'm not worried about it atm)

Unfortunately, I can't seem to find any way in the API to do it. Anyone has any idea? I assume, since it's not in the public APIs, there might still be a way to do it, if the phone is rooted. Is that true? If so, where should I look?

Thanks in advance

like image 774
Artiom Chilaru Avatar asked May 15 '11 18:05

Artiom Chilaru


2 Answers

Sorry but you can't.

You can have a look into the TelephonyManager .

You can know the current operator: getSimOperator(Name) / getNetworkOperator(Name).

You can also check this thread saying "I learn that for the sake of security there aren't any public APIs to manage this so the only option is to send the user to the system PreferenceScreen within my app."

like image 110
equesada Avatar answered Sep 30 '22 06:09

equesada


How about using android.telephony.CarrierConfigManager? I read about it on https://developer.android.com/reference/android/telephony/CarrierConfigManager.html and it seems to allow you to change alot of carrier-specific parameters, although the app must be signed with the certificate that has a matching signature to one on the SIM, so it can usually only be implemented by the carrier issuing the SIM. See also https://source.android.com/devices/tech/config/carrier.

I havent found an actual method to actively switch carrier, but if anywhere, I'd expect it to be there.

like image 37
Ethan Arnold Avatar answered Sep 30 '22 06:09

Ethan Arnold