How to use messaging in android application by using WhatsApp and WeChat?
Actually requirement is to send sms using WhatsApp and We
This is the simplest example that I get
/**
* sends message to the specific application
* @param text The message that user wants to send
* @param view is the activity view of the application
*/
public void sendMessage(String text, View view){
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setType("text/plain");
intent.setPackage("com.example.appname");//For whatsapp you can use com.whatsapp
if (intent !=null){
intent.putExtra(Intent.EXTRA_TEXT, text);
startActivity(intent);
}else{
Snackbar.make(this, "Application not found.", Snackbar.LENGTH_SHORT).show();
}
}