Android: How to send message programmatically by using WhatsApp, WeChat?

Subhalaxmi

How to use messaging in android application by using WhatsApp and WeChat?

Actually requirement is to send sms using WhatsApp and WeChat (Free sms).

Subhalaxmi

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)
                .show();
    }
}

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

Example : USE

//Whatsapp
    intent.setPackage("com.whatsapp");`

//Linkedin
    intent.setPackage("com.linkedin.android");

//Twitter    
    intent.setPackage("com.twitter.android");

//Facebook
    intent.setPackage("com.facebook.katana");

//GooglePlus
    intent.setPackage("com.google.android.apps.plus");

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

how to send message to whatsapp number programmatically using C#

Send message via whatsapp programmatically

How to send whatsapp message using Twilio asynchronously

Android : How to send app invite message using whatsapp,facebook,gmail,etc from my app

How to send new line whatsapp message using PHP/JavaScript?

Send message to particular contact through WhatsApp in android

Is there anyway to send WhatsApp message using node js?

Send message and files to whatsapp using laravel

How to send a text message with Whatsapp Cloud API

How to send a message in whatsApp by clicking on thebutton

How to send whatsapp message in whatsapp-web.js

How to Send message to a WhatsApp group without opening WhatsApp?

how to display location message in chat window same like whatsapp in android programmatically?

How to send whatsApp message to any number by using twilio using c#

How to text message send using timing in android

How can I send messages to WhatsApp using WhatsApp Cloud API without registering the recipient number prior to sending message?

how to enlist whatsapp images programmatically in android?

How to get whatsapp Contacts from Android Programmatically?

Android: How to programmatically check if a number is online on WhatsApp?

How to send whatsapp message from another android app? (see detail though)

How can I send message to specific contact through WhatsApp from my android app?

How can I Send message to WhatsApp Group and Sync contacts using WhatsAPI?

how to send whatsapp message to Paticular Contact without Click on send button

Send whatsapp audio file programmatically

Share text with WhatsApp on Android "Can't send empty message"

Send WhatsApp Notification using Pre-approved Template Message on Twilio

How do I send message programmatically in iPhone

how to send a message and wait for a reply in python, twilio in whatsapp

How to send message from WhatsApp in PHP with WhatsAPI Official?