How to embed Hangout chat in my Android App

会有一股神秘感。 提交于 2019-12-13 09:08:58

问题


my question is similar to the below one... How to embed Skype in my App

I have an android application. There we have a option to chat with our google contact user. So, We planned to use the hangout chat to achieve. Now, I just want to use the hangout chat in my android application. I should able to chat with the my google contact users from my own UI using hangout.

Thanks


回答1:


It's not possible to do without API. and API for that doesn't exist. I you want to create chat application you can use GCM.

You can write extentions for hangouts : Hangouts API. But android application integration is not possible at this moment. (And i think it never will be, because they have their protocol)

You have only one way to do this. Download whireshark or fidler and see what http requests are sent/received during the chat on your android or web hangouts chat. :)

But still i think they have some authentication and hashing that will make this impossible.




回答2:


Twilio Video is one possible solution.

The Android QuickStart includes a complete Android Studio App you can download and try.

https://www.twilio.com/docs/api/video/guide/quickstart-android

There are 4 key components to working with the API:

  • User Identity and Access Tokens
  • Conversations
  • Video and Audio Tracks
  • Event Webhooks

Getting started with the Client looks like this:

// Create an AccessManager to manage our Access Token
AccessManager accessManager = new AccessManager(ConversationActivity.this,
                                ACCESS_TOKEN,
                                accessManagerListener());

// Create a Conversations Client and connect to Twilio's backend.
TwilioConversationsClient conversationsClient =
  TwilioConversationsClient.create(accessManager, conversationsClientListener());
conversationsClient.listen();

/* See the "Working with Conversations" guide for instructions on constructing a
ConversationsClientListener */
private TwilioConversationsClient.Listener conversationsClientListener() {
  return new TwilioConversationsClient.Listener() {
    @Override
    public void onStartListeningForInvites(TwilioConversationsClient conversationsClient) {
      Log.i(TAG, "Connected to Twilio!");
    }

    ...

  };
}

Please Note: I work for Twilio



来源:https://stackoverflow.com/questions/30863348/how-to-embed-hangout-chat-in-my-android-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!