1

This below approach opens the app but doesn't do anything.

button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            String phoneNumber = "phone number here";
            String text = "Hi belated happy diwali";


            Intent smsIntent = getPackageManager().getLaunchIntentForPackage("sun.way2sms.hyd.com");
            smsIntent.setType("vnd.android-dir/mms-sms");
            smsIntent.putExtra("address", phoneNumber);
            smsIntent.putExtra("sms_body", text);
            startActivity(smsIntent);
        }
    });

2 Answers2

0

As per my knowledge, like default SMS Manager you can't send message directly with other apps....like way2sms / whatsapp. If and only if they are providing there SDK and with that option.

Do you know the 'key' -> "address" and "sms_body" are using by way2sms app to receive your data!!!!

For Eg: Facebook you can post directly with ur app by using some user permissions.

Anvesh523
  • 368
  • 6
  • 18
0

If you are using a third party app the best you can do is launch the third party app with the data pre filled just like the native app.

If the third party app provides any support for sending sms in the background (like a broadcast or something) then you can do it. Although the chances of any app having such functionality is low

Ajit Pratap Singh
  • 1,299
  • 12
  • 24