开发者

Sending an SMS using Google Voice

I have an app where I need to be able to send SMS messages. I have the code to send them directly, but I would like to give the option to use Google Voice to users who don't have messaging plans. Does anyone 开发者_开发技巧know how to do this? I can't seem to find the way. Here is the way I am doing it now:

StringBuffer buffer = new StringBuffer();
buffer.append("GEOC ");
buffer.append(mLogType.getSelectedItemPosition() == 0 ? "@" : "x");
buffer.append(mGeocache.getWaypoint()).append(" ");
if(mLogEdit.getText().length() > 0)
{
    buffer.append(mLogEdit.getText().toString());
}

SmsManager sms = SmsManager.getDefault();
sms.sendTextMessage("41411", null, buffer.toString(), null, null);


You want to use an SMS Intent.

That will give the user the option to select (or skip this step if he already have a default option) which SMS sending utility he want's to use.

several applications register themselves as such, such as skype, yahoo hub, google voice, etc.

So using a Intent, you tell android to use whatever the user wants to send the text message to a sms recipient.


It's my belief that the user must have a google voice account setup and have the voice app installed. Then when you fire an intent to send an sms it will be their preference to use google voice or not.


I've found a site where they've written their own google voice java library that you can import into your app and use. I just downloaded it yesterday so can't help with specific yet, but go ahead and take a look. It looks really promising.

http://code.google.com/p/google-voice-java/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜