2011-06-20 62 views
15

我正在Gingerbread Galaxy Tab P1000上運行最新版本的GTalk(使用市場上的Talk安裝程序)。啓動視頻通話

我現在想以編程方式發起視頻通話,只要相關聯繫人在線且可用。

,因爲我沒有發現我在看related XML任何文件,發現以下有趣的部分:

<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> 

由於它是一個「發送到」行動,我不需要特別許可,是嗎?我的問題是,我不知道如何獲得vnd.android.cursor.item/video-chat-address類型的項目。你有什麼想法或暗示我可能會嘗試什麼?

在此先感謝!

+0

(有點生鏽就可以了):你知道一個現有軟件發送一個Intent的例子嗎(從聯繫頁面可能?)。您可能會嘗試啓動視頻聊天,檢查您的LogCat,併爲您的Intent反向設計URI格式。我沒有安裝允許視頻聊天的Talk應用程序,所以我不能自己嘗試,對不起!希望這可以幫助! – OEP

回答

8

編輯:

不得不做一些黑客周圍拆卸的,但我得到這個(如電子郵件是您想要的地址):

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); 

這工作,但還是給出了是否提示你想開始視頻聊天,這不是我所需要的。希望這可以幫助其他人。

1

對不起,這不支持。深入研究這樣的應用程序正在研究它的實現細節;除非您從應用程序的作者那裏獲得支持與它的交互的文檔,否則您最好做的就是創建可能在應用程序更新後的任何時候中斷的代碼。

+1

你的意思是它不是「不能改變的東西」的一部分:) [http://android-developers.blogspot.com/2011/06/things-that-c​​annot-change.html] – Matthieu

+1

鏈接更正[http:/ /android-developers.blogspot.com/2011/06/things-that-c​​annot-change.html – WarrenT