Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
902 views
in Technique[技术] by (71.8m points)

android - What does getLine1Number() return with dual SIM phones?

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

First, which number you get back is device dependent.

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.

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...