Please guide, in Android how can I pass my string (less then 160 char) to the default built-in SMS applicaion or queue, which will complete the process.
I mean, from my activity I want to call a built-in SMS application and pass my SMS string to that, then the built-in application will be responsible to rest of activity like SMS resending, etc.
To call the default sms application, with sms body and phone number :
Intent intent = new Intent( Intent.ACTION_VIEW, Uri.parse( "sms:" + phoneNumber ) );
intent.putExtra( "sms_body", smsBody );
context.startActivity( intent );
By default I mean the application chosen by the user. Actually it's better to start the default sms application than the built-in because you have to respect the user choice. If the device owner has chosen ChompSms as default SMS application, he will prefer your application launches ChompSms and not an other.
To call the default sms application, with sms body and phone number :
Uri uri = Uri.parse("smsto:123456789");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
it.putExtra("sms_body", "The Hello How R U...");
startActivity(it);
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