Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7943471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:17:00+00:00 2026-06-04T00:17:00+00:00

I am trying to automatically send SMS message to a certain number when the

  • 0

I am trying to automatically send SMS message to a certain number when the user presses a button on the screen.

This is my code:

Intent smsIntent = new Intent(Intent.ACTION_SENDTO,
Uri.parse("sms:xxxxxxxxxxx")); 
smsIntent.putExtra("sms_body", "Hello");
startActivity(smsIntent);

xxxxxxx = phone number

I have the following permissions:

<uses-permission android:name="android.permission.SEND_SMS"></uses-permission>
<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>

When I press the button it takes me to another screen where I can edit my text and press Send. I just want it to do this process automatically without taking me to another screen. As I’ve already defined my message, I just want to send it to a particular number.

And also I am not sure if I put the corrent phone number in the second line of code. Do I have to put my country code in there first or can I just put my mobile phone number and it will work?

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:17:01+00:00Added an answer on June 4, 2026 at 12:17 am

    Try this code:

     String messageToSend = "this is a message";
     String number = "2121234567";
    
     SmsManager.getDefault().sendTextMessage(number, null, messageToSend, null,null);
    

    With regards to the number, you need to enter the number as if you were calling it from the phone or sending an sms message in the normal manner.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send an email via some C# ASP.NET code. This is being
I'm trying to write an C# application that can automatically send user id, password
I'm trying to automatically compress both CSS and JS using maven and this plugin
Am trying to send a mail to recipient from iPhone app without user's interaction.
I am trying to send a new user name to add to one of
I've been trying to send a JSON string to PHP server like this: $.ajax({
I am trying to simply send and recieve a message using GCDAsyncSocket and cannot
I'm trying to automate gmail with selenium to automatically send email as a proof
This one is a mouthful! Basically I'm trying to send all of my Rails
I'm trying to automatically switch my background image in wordpress depending on the visitors

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.