Android Question How to make whatsapp call with intent

syerif

Active Member
Licensed User
Longtime User
is it possible to make whatsapp call with intent? please help me...

Best Regards
 

DonManfred

Expert
Licensed User
Longtime User
Use Google to find out a possible Intent.
We can help you porting it to B4A.
 
Upvote 0

jahswant

Well-Known Member
Licensed User
Longtime User
Java:
String data = "content://com.android.contacts/data/" + dataId;
            String type = "vnd.android.cursor.item/vnd.com.whatsapp.profile";
            Intent sendIntent = new Intent();
            sendIntent.setAction(Intent.ACTION_VIEW);
            sendIntent.setDataAndType(Uri.parse(data), type);
            sendIntent.setPackage("com.whatsapp");
startActivity(sendIntent);

POSSIBLE SOLUTION FOUND HERE :
 
Upvote 0

syerif

Active Member
Licensed User
Longtime User
B4X:
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "content://com.android.contacts/data/" & dataId)
in.SetType("vnd.android.cursor.item/vnd.com.whatsapp.profile")
in.SetPackage("com.whatsapp")
Try
 StartActivity(in)
Catch
 Log("whatsapp not installed")
End Try
Is dataid from content resolver or can use direct variable with phone number?
 
Upvote 0

syerif

Active Member
Licensed User
Longtime User
this code
B4X:
Dim in As Intent
in.Initialize(in.ACTION_VIEW, "content://com.android.contacts/data/" & dataId)
in.SetType("vnd.android.cursor.item/vnd.com.whatsapp.profile")
in.SetPackage("com.whatsapp")
Try
StartActivity(in)
Catch
Log("whatsapp not installed")
End Try
this code do not effect to make a call ...

i also modify that code into this one and also not work

https://stackoverflow.com/questions/38655458/android-make-whatsapp-call

any suggestion?
this is my code

My code:
Dim in As Intent
    Dim tc As Technis
    Dim dataid As String=tc.GetContactIDbyPhone("62xxxxxx")
    Log(dataid)
    Dim name As String = tc.GetContactNamebyPhone("62xxxxxx")
    'Log(name)
    in.Initialize(in.ACTION_VIEW, "content://com.android.contacts/data/" & dataid)
    in.SetType("vnd.android.cursor.item/vnd.com.whatsapp.profile")
    in.SetPackage("com.whatsapp")
    Try
        StartActivity(in)
    Catch
        Log("whatsapp not installed")
    End Try
 
Upvote 0

syerif

Active Member
Licensed User
Longtime User
Java:
String data = "content://com.android.contacts/data/" + dataId;
            String type = "vnd.android.cursor.item/vnd.com.whatsapp.profile";
            Intent sendIntent = new Intent();
            sendIntent.setAction(Intent.ACTION_VIEW);
            sendIntent.setDataAndType(Uri.parse(data), type);
            sendIntent.setPackage("com.whatsapp");
startActivity(sendIntent);

POSSIBLE SOLUTION FOUND HERE :
This code work if i used inline java, i think the problem is mimetype, can i use contactutils to detect mimetype to get id from phone number?
 
Upvote 0

JUAN CARLOSORDOÑEZ

Member
Licensed User
Longtime User
Use Google to find out a possible Intent.
We can help you porting it to B4A.
Hello
Can you help me to correct a code?
I need to make an app that through INTENT sends information to another app on a payment device. I have part of the code but I still do not receive a response from the other app and I do not know why. Attached code. Thanks
 

Attachments

  • CODIGO.TXT
    3.6 KB · Views: 300
Upvote 0
Top