Read/parse Only Mobile Numbers From Android's Phonebook (contactscontract.contacts)
How to get all the real mobile numbers from androids phone book? I used ContactsContract.Contacts and created respective cursors. while it's working fine, I am stuckup with only f
Solution 1:
i do not understand completely. what do you mean with "real" mobile numbers or "valid" one. all numbers are valid as long nobody stores the latest lottery results in one of the telephone number fields :-) are you are looking for a method to verify, if a number is a mobile number and not a landline number ? is it what you are asking for ?
Solution 2:
This function uses some pre-coded stuff in Android, like the Patterns.PHONE.matcher... This might be useful:
//Returns true if phone number is valid
private boolean isValidPhoneNumber(CharSequence phoneNumber) {
return !TextUtils.isEmpty(phoneNumber) && Patterns.PHONE.matcher(phoneNumber).matches();
}
Post a Comment for "Read/parse Only Mobile Numbers From Android's Phonebook (contactscontract.contacts)"