how to use isms to send a SMS

主宰稳场 提交于 2019-12-11 15:04:27

问题


I am trying to use isms in a root shell to send a SMS but still no luck. I have tried

service call isms 4 s16 "+mynumber" s16 "" s16 "hello world!" s16 "" s16 ""

but I am seeing this in the LogCat and SMS is not going out from the device.

W/Parcel  ( 1056): Attempt to read object from Parcel 0x52ecfdac at offset 124 that is not in the object list

Is there a way to send a SMS using Shell without using SmsManager to do this..

Thanks


回答1:


Try this:

adb shell am start -a android.intent.action.SENDTO -d sms:CCXXXXXXXXXX --es sms_body "smsHere" --ez exit_on_sent true
adb shell input keyevent 22
adb shell input keyevent 66

Where CCXXXXXXXXXX is country-code followed by phone number.




回答2:


Try this command (it works for me) : service call isms 5 s16 "PhoneNumber" i32 0 i32 0 s16 "BodyText"




回答3:


For me service call isms, didn't work. I developed an application for two different chipsets, Mediatek and Spreatrum. For Mediatek(MTK), I found there API which is addon, which contains SMSManagerEx, that can send sms in dual sim. But for spreadtrum there was no API so I had to use reflection as mentioned by Maher in this post. I have my comment there as well, that sends sms from specific sim from code without prompting the default sms app.



来源:https://stackoverflow.com/questions/14846128/how-to-use-isms-to-send-a-sms

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!