开发者

Can we send sms to other non android device using SmsManager?

I am working on an android application , in which we are dealing with android sms service. I just want to know that is it possible to send sms to other non android device using the below method.

SmsManager sm = S开发者_JS百科msManager.getDefault();

// HERE IS WHERE THE DESTINATION OF THE TEXT SHOULD GO

String number = "6508570720";

sm.sendTextMessage(number, null, "Test SMS Message", null, null);

OR

Do we have any other method to achieve this task.


SMS is not a device specific feature. It is provided and controlled by Telecom / Cellular service provider. So the code should send SMS to any phone from your Android device.

You may also try the following code:

String number = "6508570720";
String message = "hi there";

Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "sms:" + number ) ); intent.putExtra( "sms_body", message ); startActivity( intent );


Yep, This should work for sending sms to non-android devices as well.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜