The document discusses messaging in Android applications. It provides code samples for sending SMS programmatically using intents and receiving SMS broadcasts. It notes that messages sent programmatically won't appear in the default messaging app and that setting android:priority to 1000 ensures your app receives broadcasts first. The document also covers testing SMS on emulators and required permissions.
3. FIRST Send SMS
Send SMS using the built-in Messaging application
public void sendSMSUsingIntent() {
Intent i = new Intent(android.content.Intent.ACTION_VIEW);
i.putExtra("address", "01923962820");
i.putExtra("sms_body", "Hello i love recursion!");
i.setType("vnd.android-dir/mms-sms");
startActivity(i);
}
5. Send SMS programmatically
The sent message will not appear in the built-in
Messaging application of the sender, if you
send SMS programmatically.
I will make a secret lover
SMS App
6.
7. Receive SMSSECOND
# write a BroadcastReceiver class
# send SMS using Broadcast Intent
# register for BroadcastReceiver
# show message
12. <uses-feature
android:name=”android.hardware.telephony”
android:required=”true”/>
Marking telephony as a required feature prevents your
application from being found on Google Play using a device
without telephony hardware support
Other permission needed for SMS Application
<uses-permission android:name="android.permission.SEND_SMS" >
</uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS" >
</uses-permission>
13. For More Cool Tutorials Visit: http://mahbubzaman.wordpress.com