I am working on an app in which i have to take the Name, Number and Email from the android device. So far I have been successful in getting the primary email address of the device by using this code.
Pattern emailPattern = Patterns.EMAIL_ADDRESS; // API level 8+
Account[] accounts = AccountManager.get(getBaseContext()).getAccounts();
for (Account account : accounts) {
if (emailPattern.matcher(account.name).matches()) {
possibleEmail = account.name;
}
}
Can i get the name and number also by doing some modification in this code? I have to do this in API 9+