Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass text to Google Voice SMS Programmatically?

Tags:

android

sms

voice

I use the following code to start the SMS application:   

Intent smsIntent=new Intent(Intent.ACTION_SENDTO,   Uri.parse("sms:"));
smsIntent.putExtra("sms_body", "Message Body");
startActivity(smsIntent);

It works fine if user selects standard "Messaging" application. But if user selects GV the message body text is ignored.

I have also tried the following as suggested in some forums:

smsIntent.putExtra(Intent.EXTRA_TEXT, "Message Body");

I have searched all the forums I know of and tried lot of things. Nothing worked for me. Am I missing something here? Does GV need a special handing that it can’t be treated as regular “Messaging” app?

like image 395
Jas Avatar asked Jan 10 '11 11:01

Jas


People also ask

Can Google Voice receive SMS?

If you have the Google Voice app installed, you also get text messages there. To stop getting 2 notifications, turn off Google Voice text forwarding. Then you'll only get texts in the Google Voice app.

Does Google Voice have API?

Google Voice Actions gives you one API to support Android phones, tablets, and Android Wear watches.

Can you send unlimited messages on Google Voice?

What is Google Voice's sending limit per text message? You can send messages up to 160 characters to any non-Google voice number. Anything above that limit will instead go out as multiple messages. Texts sent to another Google Voice number won't have a text cap.


1 Answers

Here are some thoughts that might point you in the right direction:

  • Google Voice SMS intent
  • Sending SMS using Intent does not add recipients on some devices
  • what is the difference between ACTION_SENDTO and ACTION_VIEW when sending sms?

  • Here's a third party library for accessing Google Voice: http://code.google.com/p/google-voice-java/ ...except it directly accesses Google Voice via its web URLs...

  • Here's some old (2010) Android MMS source where they manually accessed Google Voice, which might give some bonus hints:

  • Also try putting it in an extra called "data" or "pdudata"

  • Also, here's some more (old?) source mentioning some intent extras including "android.mms.extra.MESSAGE"

Hopefully one of these help you out...

like image 175
Adam Rofer Avatar answered Oct 14 '22 16:10

Adam Rofer