0

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+

Ankush
  • 197
  • 6
  • see answer here: http://stackoverflow.com/questions/9323207/how-can-i-get-the-first-name-or-full-name-of-the-user-of-the-phone – trickedoutdavid Jan 01 '14 at 17:57
  • @trickedoutdavid thanks for reply..but i have already referred this question. It says you can get but for API higher than 11, but i need it for API 9+ – Ankush Jan 01 '14 at 17:59
  • See earlier: http://stackoverflow.com/questions/6222384/possible-to-get-owner-contact-info-in-android – javawebapps Jan 01 '14 at 18:35

0 Answers0