I'm trying to send and receive binary data sms from my app (SDK 2.1-Update 1), no luck No
I have the following receivers installed in the manifest:
& lt; Receiver Android: name = ". MainReceiver" & gt; & Lt; Intro-Filter Android: Priority = "10" & gt; & Lt; Action Android: name = "android.provider.Telephony.SMS_RECEIVED" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; & Lt; Receiver Android: name = ". MainReceiver" & gt; & Lt; Intro-Filter Android: Priority = "10" & gt; & Lt; Action Android: name = "android.intent.action.DATA_SMS_RECEIVED" /> & Lt; / Intent-Filter & gt; & Lt; / Receiver & gt; I took action without data tag and without DATA_SMS_RECEIVED: & Lt; Data Android: host = "localhost" /> & Lt; Data Android: port = "16001" /> I have specified that all the permissions I can do are related to sending / receiving / reading SMS, or MMS etc. To ensure that this permission is not allowed .. I am sending an SMS to the emulator on the 5558 port, and an SMS with the amulator, for the emulator on the 5558 port.
Emulator 5554 receives normal problems without SMS,
Perhaps it has never been sent, this is the sample code that sends the SMS: / P>
SmsManager mgr = SmsManager.getDefault (); Mgr.sendTextMessage ("5554", blank, "message", blank, zero); Mgr.sendDataMessage ("5554", Faucet, (Small) 16001, "Message" .getBytes (), Faucet, Faucet); The broadcast receiver only shows a toast message when it receives something.
I have spent 5 hours Any possible combination of receiver, data tag, port number , never got anything in the form of data sms. I am out of ideas, in fact ..
It seems that Emulator data do not work well with SMS. They do not throw any exceptions, but they do not send data messages. For this reason, DataMessage () seems to work properly because it does not cause any errors, but the truth is that it does not send anything!
Using a device, everything works well!
Comments
Post a Comment