• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android - Get list of Whatsapp groups

yogeshjshah

Lurker
Dec 12, 2018
1
0
I want to get a list of whatsapp groups (group name and group link) in android.

I can get a list of contacts like this:

Code:
[INDENT]Cursor c = getContentResolver().query(
   RawContacts.CONTENT_URI,
   new String[] { RawContacts.CONTACT_ID,      RawContacts.DISPLAY_NAME_PRIMARY },
   RawContacts.ACCOUNT_TYPE + "= ?",
   new String[] { "com.whatsapp" },
   null);

ArrayList<String> myWhatsappContacts = new ArrayList<String>();
int contactNameColumn = c.getColumnIndex(RawContacts.DISPLAY_NAME_PRIMARY);
while (c.moveToNext())
{
   // You can also read RawContacts.CONTACT_ID to read the
   // ContactsContract.Contacts table or any of the other related ones.
myWhatsappContacts.add(c.getString(contactNameColumn));
}
[/INDENT]
How can I achieve a similar list of groups through code?
 
Last edited by a moderator:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones