以编程方式获取电话区域名称 [英] Get Phone region name programmatically

查看:90
本文介绍了以编程方式获取电话区域名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须以编程方式获取电话号码区域(即该电话号码所属的区域).我搜索了很多东西,但无论如何都找不到了,于是我想通过网络提供商名称获取当前位置,但它返回城市名称.实际上,第一,如果不可能,我必须获得无电话区域,然后通过网络提供商如何获得当前位置的区域.请建议我.

I have to get phone no region (means from which region this no belongs) programmatically. I searched lot and didn't find anyway then I thought to get current location through network provider name but it return city name. Actually 1st I have to get phone no region if it not possible then through network provider how can we get region of current location. Please suggest me.

推荐答案

尝试电话服务.

TelephonyManager telman=(TelephonyManager) getSystemService(TELEPHONY_SERVICE);

很多信息都可以检索为

telman.getNetworkOperatorName();
telman.getSimSerialNumber();
telman.getLine1Number();
telman.getSubscriberId();

有一个方法,telman.getCellLocation();.我还没有尝试过,也许您可​​以尝试.

There is a method, telman.getCellLocation(); . I didn't try it yet, may be you can try.

这篇关于以编程方式获取电话区域名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆