According to WhatsApp FAQ
There are two ways to integrate with WhatsApp:
-Through a custom URL scheme
-Through Android's intent system.
Custom URL Scheme
If you want to open a WhatsApp chat with a
pre-filled message, you can use our custom URL scheme to do so.
Opening whatsapp://send?text= followed by the text to send, will open
WhatsApp, allow the user to choose a contact, and pre-fill the input
field with the specified text.
Example
https://api.whatsapp.com/send?phone=15551234567&text=I%27m%20interested%20in%20your%20car%20for%20sale
Android intent system
Like most social apps on Android, WhatsApp listens to intents to share
media and text. Simply create an intent to share text, for example,
and WhatsApp will be displayed by the system picker:
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
sendIntent.setPackage("com.whatsapp");
sendIntent.setType("text/plain");
startActivity(sendIntent);
OR
With this code you can open the whatsapp chat with the given number.
void openWhatsappContact(String number) {
Uri uri = Uri.parse("smsto:" + number);
Intent i = new Intent(Intent.ACTION_SENDTO, uri);
i.setPackage("com.whatsapp");
startActivity(Intent.createChooser(i, ""));
}
You cannot set user status programmatically.
You can also see these for some more details:
- One
- Two