Using the native sms app to send an sms without launching itself

前端 未结 5 1154
忘掉有多难
忘掉有多难 2020-12-15 14:48

I want to send an SMS, but not using the SmsManager class. I want to do it with the native SMS app which is there on an Android phone.

And here is the twist : I do

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-15 15:34

    I have done something similar in a project I was working on. You need to use SmsManager

    It would be something like this -

            SmsManager smsManager = SmsManager.getDefault();
    
            smsManager.sendTextMessage(phoneNumber, null, message, null, null);
    

    You can use this to send an SMS programatically.

提交回复
热议问题