Sending SMS from Android


How can my Android Processing app send SMS from the Android device?


in order to do that there are several solutions: eg you can create an instance of smsManager and send your message(text message) to some phone number:

SmsManager smsManager = SmsManager.getDefault();
                  smsManager.sendTextMessage(telNumero, null, myMessage, null, null);

or you can do that with an intent and using the built in sms with ACTION_VIEW:

Intent mySmsIntent = new Intent(Intent.ACTION_VIEW);
mySmsIntent.setData(Uri.parse("smsto:"));//nothing to change
mySmSIntent.setType("");//nothing to change
mySmsIntent.putExtra("address"  , new String("0123456789;9876543210"));//phone(s) number(s): here 2
mySmsIntent.putExtra("sms_body"  , "happy birthday to you");// the message

of course you need sms permissions
and of course you have to addapt the code to fragment (this.getActivity()) if you are using P5 >vs 3


Possible relevant:



Thank you, @akenaton! That was neat…