以编程方式更改网络选择模式
我正在尝试(想知道是否有可能)编写一个应用程序,它将根据某些标准自动更改网络选择模式。例如,将网络运营商从沃达丰更改为T-Mobile(假设SIM卡注册会成功,但我不担心atm)
不幸的是,我似乎无法在API中找到任何方法来做到这一点。有人有什么想法吗? 我认为,由于它不在公共 API 中,因此如果手机已 root,可能仍然有办法做到这一点。这是真的吗?如果是这样,我应该去哪里寻找?
提前致谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
抱歉,但你不能。
您可以查看 TelephonyManager 。
您可以通过 getSimOperator(Name) / getNetworkOperator(Name) 来了解当前的操作员。
您还可以查看此线程,内容是“为了安全起见,我了解到这一点没有任何公共 API 可以管理此操作,因此唯一的选择是将用户发送到我的应用程序中的系统 PreferenceScreen。”
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."
使用 android.telephony.CarrierConfigManager 怎么样?我在 https://developer.android.com/reference/android 上读到了它/telephony/CarrierConfigManager.html 它似乎允许您更改许多运营商特定的参数,尽管应用程序必须使用与 SIM 卡上的签名匹配的证书进行签名,因此通常只能由发行SIM卡的运营商实施。另请参阅 https://source.android.com/devices/tech/config/carrier< /a>.
我还没有找到主动切换运营商的实际方法,但如果有的话,我希望它在那里。
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.