I want to execute the compose message - SMS
(Default application in the android phones) after a user clicked a Button
inside my android app.
Is this imposibble?
I want to execute the compose message - SMS
(Default application in the android phones) after a user clicked a Button
inside my android app.
Is this imposibble?
You can use below code to send sms in android:
Intent smsIntent = new Intent(Intent.ACTION_VIEW);
smsIntent.setData(Uri.parse("smsto:"));
smsIntent.setType("vnd.android-dir/mms-sms");
smsIntent.putExtra("address" , new String ("0123456789"));
smsIntent.putExtra("sms_body" , "Test SMS Body");
try {
startActivity(smsIntent);
finish();
Log.i("Finished sending SMS...", "");
} catch (android.content.ActivityNotFoundException ex) {
Toast.makeText(MainActivity.this,
"SMS faild, please try again later.", Toast.LENGTH_SHORT).show();
}
Hope it will help you..