15

I am running the latest version of GTalk (using the Talk installer from the market) on my Gingerbread Galaxy Tab P1000.

I now want to programatically initiate a video call provided that the related contact is online and available.

As I didn't found any documentation for that I looked in the related XML and found the following interesting part:

  <activity-alias android:icon="@drawable/ic_launcher_google_videochat" android:name="PublicCallIntentDispatcher" android:targetActivity="PublicIntentDispatcher">
            <intent-filter>
                <action android:name="android.intent.action.SENDTO" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="vnd.android.cursor.item/video-chat-address" android:scheme="xmpp" />
            </intent-filter>
        </activity-alias>

As it is a "Send-To" action, I don't need a special permission, do I? My problem is, that I don't know how to get an item of the type vnd.android.cursor.item/video-chat-address. Do you have any idea or hint what I might try?

Thanks in advance!

muffel
  • 6,043
  • 4
  • 42
  • 77
  • (bit rusty on this): Do you know an instance in which some existing software sends an Intent like this (from contacts page maybe?). You might try to initiate a video chat, check your LogCat, and reverse-engineer the URI format for your Intent. I haven't got a Talk app installed which allows video chat so I can't try it myself, sorry! Hope this helps! – OEP Jun 30 '11 at 21:50

2 Answers2

9

Edit:

Had to do a bit of hacking around disassembling but I got this (where email is the address you want):

Uri imUri = new Uri.Builder().scheme("xmpp").authority("gtalk").query("call;type=video").appendPath(email).build();
Intent IM = new Intent(Intent.ACTION_SENDTO);
IM.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
IM.setData(imUri);
startActivity(IM);

This works, but still gives a prompt on whether you want to start a video chat, which is not quite what I need. Hope this helps some other people.

eb4890
  • 106
  • 1
  • 3
2

Sorry, this is not supported. Digging in to an application like that is looking at its implementation details; unless you get documentation from the author of the application of what interactions with it are supported, the best you can do is come up with code that is likely to break at any point in the future when that application is updated.

hackbod
  • 88,517
  • 16
  • 135
  • 152
  • 1
    You mean it's not part of "the things that cannot change" :) [http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html] – Matthieu Jul 03 '11 at 06:39
  • 1
    Link correction [http://android-developers.blogspot.com/2011/06/things-that-cannot-change.html – WarrenT Nov 04 '11 at 10:44