导入自己的手机号码 [英] Import Own mobile Number

查看:172
本文介绍了导入自己的手机号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我要导入我的手机号码。我知道,电话联系被ContactsContract API进口,而我是个要求进口的手机号码这是显而易见的,而不是在电话联系的细节present。

In my App i want to import my mobile number. I know that phone contact is imported by ContactsContract API but i ma asking for importing own mobile number which is obvious , not present in phone contact detail.

推荐答案

该手机号码是通过电话API不再普遍提供。如果你能看到在设置正确的电话号码 - 关于手机> - >状态然后是,你会得到它。但除此之外,没有。我有几个手机运行Android 2.3,4,4.1和4.2,其中没有显示出与SIM卡相关联的电话号码。

The handset number is no longer generally available through the telephony API. If you can see the correct phone number in settings -> about phone -> status then yes, you'll get it. But otherwise, no. I have several phones running Android 2.3, 4, 4.1 and 4.2 and none of them show the phone number associated with the SIM card.

由于没有电话号码不应该是一个大难题。我已经工作了一段时间的SMS应用程序,并在几个月前得出的结论,我只是不需要知道手机号码 - 在所有

Not having the phone number shouldn't be a major headache. I've been working on an SMS application for some time and came to the conclusion several months ago that I just don't need to know the handset number - at all.

如果您需要的手机号码一个很好的理由,然后使用联系人供应者,你可以访问该设备的联系人卡片可能在其上有一个或多个移动电话号码(或根本没有!)。我的建议是使用这条路线来获得可用的数字,然后要求用户挑选一个是手机号码,并给他们输入一个数字如果是以上都不是的机会。

If you need the handset number for a good reason then using the Contacts provider you can get access to the device's contact card which may have one or more mobile numbers on it (or none at all!). My suggestion is to use this route to get the available numbers and then ask the user to pick the one that is the handset number, and give them the opportunity to enter a number if it is "none of the above".

如果您想验证号码,你可以从手机发送短信给自己或使用短信服务发送手机消息(有点像有一个网络上创建一个帐户时,确认的电子邮件地址站点)。

If you want to verify that number you could send a text message from the handset to itself or use a text message service to send the handset a message (a bit like having to confirm an email address when creating an account on a web site).

这篇关于导入自己的手机号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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