Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
256 views
in Technique[技术] by (71.8m points)

android - Initiating Video Call

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...