I want to send sms.
What is the intent for SMS sending...or any other code? I want to show compose sms view with my pre-define text passing over in message field.
Is there any help for that?
I want to send sms.
What is the intent for SMS sending...or any other code? I want to show compose sms view with my pre-define text passing over in message field.
Is there any help for that?
I add my SMS method if it can help someone. Be careful with smsManager.sendTextMessage, If the text is too long, the message does not go away. You have to respect max length depending of encoding. More information here SMS Manager send mutlipart message when there is less than 160 characters
//TO USE EveryWhere
//Manifest
//JAVA
Try the below code and then call,
sendSMS("99999999999", "message");
to send sms in desired number.Please place the following permission into
AndroidManifest.xml
file.Hope this might help.
Update From the comment: DummyClasshere.class is an activity without doing any process or the class in which u need to navigate.
Some of what is explained above is meant only for placing an SMS in a 'ready to launch' state. as Senthil Mg said you can use sms manager to send the sms directly but
SMSManager
has been moved toandroid.telephony.SmsManager
I know it's not a lot of more info, but it might help someone some day.
Include the following permission in your AndroidManifest.xml file
This will definitely work, In this, Send message without using any intent .
This code is used for send message in background (Not showing message composer), It can also work inside the Broadcast receiver. If you want to send a message from Broadcast receiver.
You can use the following code:
Make sure you set
phoneNumber
to the phone number that you want to send the message toYou can add a message to the SMS with (from comments):