I have googled this but cannot find an answer, do someone know how to send android Hangouts chat message to specific number through code?
Asked
Active
Viewed 909 times
2 Answers
1
Using this you can open both hangout and messenger app.
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("smsto:"));
//Adding message which is to be sent (both are compulsory to compensate for all android versions)
intent.putExtra(Intent.EXTRA_TEXT, "shareMessage");
intent.putExtra("sms_body", "shareMessage");
//Addres which is to be sent to (Optional)
intent.putExtra("address", "12125551212"); //Optional
startActivity(intent);

Saurabh Garg
- 4,694
- 1
- 11
- 8
0
Hmm, are you saying using Hangout App? which is built in as SMS app?
Intent smsIntent = new Intent(Intent.ACTION_VIEW);
smsIntent.setType("vnd.android-dir/mms-sms");
smsIntent.putExtra("address", "12125551212");
smsIntent.putExtra("sms_body","Body of Message");
startActivity(smsIntent);

Allan Jiang
- 11,063
- 27
- 104
- 165
-
No, not SMS message but chat message. – user2638062 Jan 23 '14 at 22:27