本文介绍了什么是getLine1Number()返回带有双卡手机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是什么 getLine1Number() TelephonyManager 收益有双SIM卡手机一样的?

What does getLine1Number() method of TelephonyManager return with dual SIM phones like LG Optimus Net Dual?

推荐答案

您将得到只有一个号码......也许吧!

You'll get back only one number ... maybe!

首先,哪个号码得到的回复是设备相关的。

First, which number you get back is device dependent.

但同样重要的是否你会得到一个数字是,这个数字是否将电话号码,是完全取消predictable。这是SIM卡和运营商而定。

But equally importantly whether you will get a number at all, and whether this number will be the phone number, is completely unpredictable. This is SIM and operator dependent.

在我的应用程序之一,我开始尝试使用手机号码作为唯一的ID,因为我可以期望用户能够轻松地记得这个号码。对于大多数运营商在亚洲,澳大利亚和一些欧洲的电话号码(line1number())根本就没有存储在SIM卡!有了别人,你可能会得到零的字符串。或数字的方式,可能是有意义的地方,但格式可能弄乱你的应用程序的逻辑。

In one of my apps, I started off trying to use the phone number as a unique ID, since I could expect the user to recall this number easily. For most operators in Asia, Australia and some in Europe, the phone number (line1number()) is simply not stored on the SIM! With others, you may get a string of zeroes. Or a number formatted in a way that may make sense locally but could mess up your app's logic.

这篇关于什么是getLine1Number()返回带有双卡手机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-22 12:42