androidsmssend

Share via SMS only


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


Solution

  • To send sms using intents, use this code:

    String smsBody="Sms Body";
    Intent sendIntent = new Intent(Intent.ACTION_VIEW);
    sendIntent.putExtra("sms_body", smsBody); 
    sendIntent.setType("vnd.android-dir/mms-sms");
    startActivity(sendIntent);
    

    I hope this help!