How to get protocol name of an IM

14 views
Skip to first unread message

tahmi...@gmail.com

unread,
Aug 10, 2014, 5:28:26 AM8/10/14
to ez-vcard...@googlegroups.com
I am trying to get all IM from contact in android device.

To add this in vcard I have to know the protocol name. For example...

Impp impp = new Impp("aim:joh...@aol.com");
vcard.addImpp(impp);

But I cannot get the names of the protocol.

String imName = imCur.getString(imCur .getColumnIndex(ContactsContract.CommonDataKinds.Im.DATA));

String imType = imCur.getString(imCur .getColumnIndex(ContactsContract.CommonDataKinds.Im.PROTOCOL));

Here Im.PROTOCOL gives me some integer value for IMs... like 0, 1, 2

so i am trying to do it like this..

int imtypeInt = Integer.parseInt(imType);
String typeStr = "";

switch (imtypeInt) {
case Im.PROTOCOL_AIM:
typeStr = "aim";
break;
case Im.PROTOCOL_MSN:
typeStr = "msn";
break;
case Im.PROTOCOL_YAHOO:
typeStr = "";
break;
case Im.PROTOCOL_SKYPE:

break;
etc......

But I dont know all the protocol names of the IMs. How can I get them.

And is my approach is right?

please help...


Mike Angstadt

unread,
Aug 10, 2014, 9:58:58 AM8/10/14
to ez-vcard...@googlegroups.com
Hello,

Here you go! :)
  • aim - Im.PROTOCOL_AIM
  • icq - Im.PROTOCOL_ICQ
  • msn - Im.PROTOCOL_MSN
  • ymsgr - Im.PROTOCOL_YAHOO
  • skype - Im.PROTOCOL_SKYPE
These are the only ones that I know of. :(

Mike




--
You received this message because you are subscribed to the Google Groups "ez-vcard-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ez-vcard-discu...@googlegroups.com.
To post to this group, send email to ez-vcard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ez-vcard-discuss/03d6c825-656c-4c54-aa95-2a4a952eebb1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Mike Angstadt
Assistant Electronic Resources Librarian, Computer Lab
Montgomery County-Norristown Public Library
1001 Powell Street | Norristown, PA 19401

Any views or opinions expressed in this e-mail are those of the sender and not necessarily coincide with those of the organization.The information in this email is confidential. The contents may not be disclosed or used by anyone other than the addressee. If you are not the intended recipient, please notify us immediately at the above address.
Reply all
Reply to author
Forward
0 new messages