CRTC Electronics

Click here to edit subtitle

Sending a text

just a few lines of code to send a text


Add permission to the Manifest file, 

In the Manifest file select the Permissions tab

click the Add button

chose Uses Permission

On the right half of the dialog box open the Name drop down and select  .SEND_SMS

save


You may need to edit the these line in the Manifest.xml file





Add this code when you want to send a SMS


android.permission.SEND_SMS







<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="10"/>




SmsManager sm = SmsManager.getDefault();

sm.sendTextMessage("20826112345", null, "hi", null, null);