title: How to check if phone number is valid in android
body: <p>On my application's signup page I have an OTP checking.</p>
  <p>My problem is I want to validate the phone number before sending OTP.</p>
  <p>How to can I create a phone number validation regex according to the extension(for Oman +968, for Canada +1)</p>
  <p>I have tried PhoneNumberUtils.isGlobalPhoneNumber(phoneNumber); api for validating phone number. But the api always returns true.</p>
  <p>For example, I have passed &quot;0&quot; to the API, but it returns true.</p>
  <p>Is there any better option to validate the phone number with the country extension code?</p>