Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Start video call in Hangouts or Duo using intent? [closed]

I am looking for a way to start a video call in either Hangouts or Duo. There seems to be 0 documentation regarding what intents should be used. Does anyone have an idea?

like image 762
Konstantin Milyutin Avatar asked Feb 13 '20 17:02

Konstantin Milyutin


People also ask

Is Google Duo just video call?

Google Duo is the highest quality video calling app*. It's simple, reliable, and works on smartphones and iPad, and on the web. Duo works on iPhone, iPad, web, and other mobile platforms so you can call and hangout with friends and family using just one app. You can also share and join group calls with just a link.


2 Answers

Let's consider Duo here.

Research

1.First of all, to find out the intent, you should activate the USB debug mode on your phone - please refer to this answer to find out how to do it.

2.Then, connect your phone to your computer so that you could see the logcat from your device (debug level should be info).

3.Open Contacts(from Google) and find a contact to whom you can call using Duo. Now, start the call and search for com.google.android.apps.tachyon. There will be a couple of matches but the important one looks something like:

START u0 {act=com.google.android.apps.tachyon.action.CALL typ=null flg=0x0 cmp=ComponentInfo{com.google.android.apps.tachyon/com.google.android.apps.tachyon.ExternalCallActivity}} from uid 10031

4.So, once you know the component info for your Duo app, just add the following code in your app from where you'd like to start a video call.

val intent = Intent()
intent.setAction("com.google.android.apps.tachyon.action.CALL")
intent.setClassName("com.google.android.apps.tachyon",
    "com.google.android.apps.tachyon.ExternalCallActivity")
startActivity(intent)

5.You'll see a video call screen with possible contacts.

Conclusion

If you'd like to find out how to start a video call or chat or something else, try to do the same as above - do it manually first and check what intents (and arguments) are used in those cases.

like image 79
Anatolii Avatar answered Oct 19 '22 18:10

Anatolii


There isn't any API documentation available for google duo app integration right now.

You can use this code it's working for starting a duo call.

String data = "content://com.android.contacts/data/" + ID;
// Build the intent
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.addCategory(Intent.CATEGORY_DEFAULT);
// the _ids you save goes here at the end of /data/id
intent.setData(Uri.parse("content://com.android.contacts/data/" + ID));
//For audio call
intent.setComponent(new ComponentName(packageName, "com.google.android.apps.tachyon.ContactsAudioActionActivity"));
//use this for video call
//intent.setComponent(new ComponentName(packageName, "com.google.android.apps.tachyon.ContactsVideoActionActivity"));
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// Verify it resolves
PackageManager packageManager = context.getPackageManager();
List<ResolveInfo> activities = packageManager.queryIntentActivities(intent, 0);
boolean isIntentSafe = activities.size() > 0;
// Start an activity if it's safe
if (isIntentSafe) {
    context.startActivity(intent);
    Toast.makeText(context, "Opening Duo", Toast.LENGTH_SHORT).show();
}

Or You can use following approach passing telephone number

Intent intent = new Intent();
intent.setPackage("com.google.android.apps.tachyon");
intent.setAction("com.google.android.apps.tachyon.action.CALL");
intent.setData(Uri.parse("tel:1234567890"));
startActivity(intent);
like image 41
Muzammil Husnain Avatar answered Oct 19 '22 17:10

Muzammil Husnain