Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Receiving GTalk messages in own app?

I'm new to Android Development. I'm a big fan of Android's Inbuilt Talk app, but what I hate about it is lack of customizable notification, so I decided to develop an app for it.

My requirement is an app that keeps watch over GTalk, and display pre-customized notifications when a message is received.

Please note that I don't want my app to ask user for GTalk username or password. I'm aware of Asmack library, but it is more useful for an IM Client, my requirement is just to grab the incoming message event. (Something like BroadcastReceiver for SMS?)

Is it possible to retrieve the Gtalk messages like you can retrieve SMS messages with a BroadcastReceiver?

like image 237
Shariq Avatar asked Apr 13 '13 16:04

Shariq


2 Answers

There are no documented and supported means of doing this, and I sincerely hope that Google didn't leave in some undocumented, unsupported, and unsecured means of doing this.

like image 110
CommonsWare Avatar answered Oct 24 '22 05:10

CommonsWare


While it's not documented, the Google Services Framework exposes permissions that give you access to the Google Talk content provider (GTalk Super Notifier uses one of those to do its magic). I couldn't find any documentation on that content provider, though, so you would have to reverse engineer it.

Here are the relevant permissions:

+ group:android.permission-group.MESSAGES
  + permission:com.google.android.providers.talk.permission.READ_ONLY
    package:com.google.android.gsf
    label:read instant messages
    description:Allows apps to read data from the Google Talk content provider.
    protectionLevel:dangerous
  + permission:com.google.android.providers.talk.permission.WRITE_ONLY
    package:com.google.android.gsf
    label:write instant messages
    description:Allows apps to write data to the Google Talk content provider.
    protectionLevel:dangerous

As an aside, it's a bizarre that Google would expose permissions with protectionLevel="dangerous" and not document their use.

like image 2
Delyan Avatar answered Oct 24 '22 05:10

Delyan