Subhalaxmi Nayak Subhalaxmi Nayak - 9 months ago 45
Android Question

Android: How to send message programatically by using whats app , We chat?

Unfortunately I have unable to found any idea how to use messaging in android application by using WhatsApp and WeChat ??

Actually requirement is to send sms using whats app and we chat ( Free sms ). So can someone helps me and shares some knowledge that how to do this ? Any Idea Or Any Tutorial ?


Answer Source

I got the Solution.. Here I am posting the answer so that it may help other people who may have same doubt..

For Share through any application...

 public void sendAppMsg(View view) {

    Intent intent = new Intent(Intent.ACTION_SEND);
    intent .setType("text/plain");
            String text = " message you want to share..";

// change with required application package

    intent .setPackage("PACKAGE NAME OF THE APPLICATION");
    if (intent != null) {
        intent .putExtra(Intent.EXTRA_TEXT, text);//
        startActivity(Intent.createChooser(intent  , text));
    } else {

        Toast.makeText(this, "App not found", Toast.LENGTH_SHORT)


Note : change *PACKAGE NAME OF THE APPLICATION as per your requirement like

Example : USE