Is it possible to get contacts from my Skype account in android?
Asked Answered
P

1

6

I have implemented Skype video/audio calling functionality using Intent in my application it is working fine. But now I want to get all contacts list from Skype account is it possible?.

Is there any alternate way to show list of contacts of Skype account please give any idea?

Purpura answered 13/5, 2014 at 13:16 Comment(5)
Have to tried to implement skype Api?Cleocleobulus
No. I am doing this by intentPurpura
I think you should use its API to access the accounts here- developer.skype.com/skype-uris/referenceCleocleobulus
@Shashank can you tell me specific way or uri for do this...pleasePurpura
I'm not sure, but I think this link will be helpful for you: https://mcmap.net/q/1482183/-how-to-get-skype-info-from-the-android-contact-listHildebrand
R
3

All contacts (provided they are synced) can be queried with the ContactsContract provider. The RawContacts.ACCOUNT_TYPE column of the RawContacts table indicates the account type for each entry ("raw" means that it contains all entries, e.g. multiple rows for a single person with multiple aggregated contacts).

To read the Skype contacts, you can do something like this:

Cursor c = getContentResolver().query(
                RawContacts.CONTENT_URI,
                new String[] { RawContacts.CONTACT_ID, RawContacts.DISPLAY_NAME_PRIMARY },
                RawContacts.ACCOUNT_TYPE + "= ?",
                new String[] { "com.skype.contacts.sync" },
                null);

int contactNameColumn = c.getColumnIndex(RawContacts.DISPLAY_NAME_PRIMARY);
ArrayList<String> mySkypeContacts = new ArrayList<String>();

while (c.moveToNext())
{
    /// You can also read RawContacts.CONTACT_ID to query the 
    // ContactsContract.Contacts table or any of the other related ones.
    mySkypeContacts.add(c.getString(contactNameColumn));
}

Be sure to also request the android.permission.READ_CONTACTS permission in the AndroidManifest.xml file.

Rogatory answered 31/5, 2014 at 19:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.