How to change sender mobile number in Android SMS service

前端 未结 2 1393
失恋的感觉
失恋的感觉 2021-01-07 07:41

I\'m sending SMS in my Android App,

 SmsManager sm = SmsManager.getDefault();
    String number = \"1234567890\";
    sm.sendTextMessage(number, null, \"Test         


        
2条回答
  •  灰色年华
    2021-01-07 08:12

    No. It is not possible. Here are multiple reasons why:

    • When you send an sms, using SmsManager you encode it with the content - the actual text message itself. You also encode it with the phone number you are sending it to. And you encode the message center number to the message. That is all you get to encode. Then Android/hardware handles sending it over to the cell phone tower where it is then out of your hands.
    • If you somehow tried to encode the recipient phone number as text, then the carrier would have no idea how to handle the message. It wouldn't have anywhere to send it too.
    • Cell phones do not have inbound Caller (or sms) ID - unless the number is already programmed, of course.
    • When the carrier network is sending an sms, it goes through a message center. The message center determines what data is forwarded to the recipient phone. The message centers currently available just do not support what you're wanting - at least not to the consumer.

提交回复
热议问题