0

In my Android app, how can I do real validation of mobile number?

Like:-


If(MobileNumber.isExists())
    return true;
else
    return false;

Note:- No fake validation is required.

Can anyone do this, I am waiting for the right answer.

S Kumar
  • 242
  • 3
  • 12
  • Are you trying to verify if the mobile number is a real phone number in the world? Or simply if the device you are on *has* a mobile number attached to it? – PGMacDesign Oct 24 '19 at 21:50
  • I believe your question has been asked and answered before. https://stackoverflow.com/questions/2480288/programmatically-obtain-the-phone-number-of-the-android-phone – Vivek Vinodh Oct 25 '19 at 09:28

1 Answers1

0

when you say real validation do you mean a phone number that already exists? Or a phone number that would be an appropriate value? I am unsure how to check if a phone number is in circulation but you could do a check to see if it is an appropriate length.

String mobileNumber;
int countryMobileLength;

if(mobileNumber.length() == countryMobileLength) {
    return true;
} else {
return false;
}