My app has an image button which on click should send a piece of text via SMS only. How do i get my app to do that? Please help.
I also want to the user to be able to choose a contact from the list of contacts on his device.
Jumana
Steps to enable sending sms:
1- In android-manifest, add sending sms permission as below:
<uses-permission android:name="android.permission.SEND_SMS" />
2- In yout Activity add this method:
public void sendSms(final String receiverNumber, final String smsBody) {
SmsManager smsManager = SmsManager.getDefault();
smsManager.sendTextMessage(receiverNumber, null, smsBody, null, null);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With