Is it possible to send message to a specific contact through whatsapp
directly from another app? I know the contact ID. I don\'t want to open whatsapp
I hope this code helps you
String text = "This is a test";// Replace with your message.
String toNumber = "xxxxxxxxxx"; // Replace with mobile phone number without +Sign or leading zeros, but with country code
//Suppose your country is India and your phone number is “xxxxxxxxxx”, then you need to send “91xxxxxxxxxx”.
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://api.whatsapp.com/send?phone="+toNumber +"&text="+text));
startActivity(intent);