简体   繁体   中英

How to prompt user to enter a valid mobile phone number?

I am currently developing an Android anti-theft application and I am new in Android development. My apps is able to remotely lock the lost phone, so during configuration, user needs to enter a valid phone number, but how I determine whether the phone number entered is valid? Thanks

-Option one : read(get) the phone number from the sim card (if available, not all operators enable this)

-Option two : If sim card changed(sim serial number) lock the phone and send sms to an other phone number (since the thief will throw away the sim card )

-Option three : use what WHatApp android application uses to identify a person (sending an sms to a specified phone number and detect the incoming sms) Option 3 seems a bit complicated since you will need a sever side with an sms gateway.

Well here's what comes to my mind .Good luck.

I believe it is impossible to verify whether a phone number exists unless you call it. You could create a procedure where the app would call the entered phone number, and timed its connection. If the connections last longer than X amount of seconds, it is a valid phone number.

If you connect a data base so, compare to the phone number with to enter a phone number in field. I hope help you. :)

I did a project for a client where a same scenario was raised. Here is what we came to conclusion.

Send an SMS to the Number input and ask the number to send an sms code in reply.

eg. CONFIRM
  1. If the number is valid and known to the user he will call them up and ask them to SMS back.
  2. If the number is valid and in use the message will get deliverd.

The client agreed the above scenario. Unless you have a really big Database of working numbers (updated so often), it will be a bypass solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM