use*_*492 4 android service-provider
我被分配了一个访问移动服务提供商名称而不是位置的任务.我搜索并提到了很多东西.但我找不到.显示所有位置(即纬度和经度值),其中一些显示网络提供商名称.我需要像Cell Info Display Name这样的东西.
Example: If I'm using Vodafone Network it will display the service provider name that my mobile is currently using.
Run Code Online (Sandbox Code Playgroud)
我不需要在地图中显示位置和位置.我只需要显示服务提供商名称.有什么方法吗?有谁可以通过示例代码解释?
小智 5
// Returns the alphabetic name of current registered operator
public String getServiceProvider() {
TelephonyManager manager = (TelephonyManager)
getSystemService(Context.TELEPHONY_SERVICE);
String carrierName = manager.getNetworkOperatorName(); // alphabetic name of current registered operator
return carrierName;
}
Run Code Online (Sandbox Code Playgroud)
示例输出:沃达丰
| 归档时间: |
|
| 查看次数: |
5548 次 |
| 最近记录: |