Is it 开发者_StackOverflowpossible to use port numbers(to Send SMS) in Android App like we use in J2ME. So that only those App which have the same Port Number can listen.
I do realise this is an old post but since it has got some views, I will answer this question.
This is quite simple. Create two instances of AVD and in place of phNo put one of your Avd's port number which you can find on top-left corner of AVD window (Or use $ /opt/android-sdk/platform-tools/adb devices
). Port number is something like 5554.
SmsManager sm = SmsManager.getDefault();
sm.sendTextMessage(portNo, null, "this is a message", null, null, null);
精彩评论