6

I want to start a new hangout conversation with given people, but I can't find any code for it. Is there any easy solution to do this? I tryed to make skype call, and it worked easyly with an intent.

Here is the skype code:

                Intent sky = new Intent("android.intent.action.VIEW");
                sky.setData(Uri.parse("skype:" + nickname));
                startActivity(sky);

I want something similar to this. (Or with skype how can I make a conference call? )

borisdiakur
  • 10,387
  • 7
  • 68
  • 100
Cselt
  • 81
  • 1
  • 4
  • How did you find about how to do it for skype? is it also possible to put a phone number instead of a nickname? What about putting text, so that all the user needs to do is click "send" ? – android developer Mar 14 '16 at 10:08

4 Answers4

3

There is currently no way to create a Google+ hangout on an android device using an intent or any other API.

This would be a pretty cool feature, though. If you request it, they might add it.

mimming
  • 13,974
  • 3
  • 45
  • 74
2

I think I found the solution, it's quite simple, here is the code:

Intent sky = new Intent("android.intent.action.VIEW", Uri.parse("https://talkgadget.google.com/hangouts/extras/talk.google.com/myhangout"));
startActivity(sky);

You just need to give the url of the hangout, but unfortunately google suspended the named hangots, so this url every time changes. :(

Cselt
  • 81
  • 1
  • 4
  • Yes this works fine from an Android tablet. The name of the hangout is in the upper part of the owner's screen... eg https://plus.google.com/hangouts/_/fc6d840c5de1226478d64d1872f6262d5dd2acb0?hl=en-GB What I need now is the 'trick' to skip the "Join" button – user462990 Jun 11 '13 at 13:33
  • How do I set here which contact to open the chat with? And how do I know how to change the url? – android developer Mar 14 '16 at 08:52
0
       public static void sendHangout(Context ctx, String message, String urlShare, String imgPath){
            Intent hangouts = new Intent(Intent.ACTION_SEND);
                if(!Utilities.isNullorEmpty(imgPath)){
                    String file = (String)imgPath.subSequence(0, imgPath.lastIndexOf("/") + 1) + message.replace(" ", "").replace(":", "").replace(".", "")
                            .replace("/", "") + ".jpeg";
                    Utilities.copyFile(imgPath, file);
                    hangouts.setType("image/*");
                    hangouts.putExtra(Intent.EXTRA_STREAM, Uri.parse("file:///" + file));
                }
            hangouts.setPackage("com.google.android.talk");
            hangouts.setType("text/plain");
            hangouts.putExtra(Intent.EXTRA_TEXT, message + ": \n" + urlShare);
            ctx.startActivity(Intent.createChooser(hangouts, "Hangouts is not installed."));    
}

I hope help you.

Javier
  • 23
  • 2
  • 9
0
Intent i = context.getPackageManager().getLaunchIntentForPackage("com.google.android.talk");
context.startActivity(i);
legoscia
  • 39,593
  • 22
  • 116
  • 167