Actually I met the similar question. Here is my use case:
Simulator 5554 uses sendDataMessage to send a data message to
simulator 5556.
Simulator 5556 is running an app which is mainly a subclass of
BroadcastReceiver to listen to incoming data message
(android.intent.action.DATA_SMS_RECEIVED). Unfortunately the onReceive
is never called. It seems that 5556 receives an incoming text message
instead of data message. If the BroadcaseReceiver also listens to text
message(android.provider.Telephony.SMS_RECEIVED), it can receive the
incoming text message event.
>From the above experience, I guess maybe it is a bug of emulator?
Since I don't have a G1 phone, I cann't verify it.
But I don't quite understand the two points in your article:
1. Why do you use permissions like
android.permission.RECEIVE_WAP_PUSH, android.permission.READ_SMS and
android.permission.RECEIVE_MMS? It seems that
android.permission.RECEIVE_SMS is the only related permission, so I
only use this in manifest.
2. You mentioned that "Actually this works if I remove the <data />
tags from the intent- filter. So I can send and receive data sms and
sms". Can you receive data message after removing the <data /> tags?
Actually I don't have these tags at all, but I cann't receive data
message.
For the question about how to get the port number, I think maybe you
can try this in onReceive on condition that you can receive a data
message:
public void onReceive(Context context, Intent intent) {
String uricontent = intent.getDataString();
str = uricontent.split(":");
String strPort = str[str.length-1];
//Pls refer to frameworks/base/telephony/java/com/android/internal/
telephony/gsm/SMSDispatcher.java dispatchPortAddressedPdus(), thr Uri
is like sms://localhost: +port
short port = strPort.valueOf(strPort);
......
}
Expecting your response! Thx!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---