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

  • Home
  • SEARCH
  • 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 8011481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:01:44+00:00 2026-06-04T19:01:44+00:00

I wish to achieve a SMS loopback, i.e. to send and receive SMS from

  • 0

I wish to achieve a SMS loopback, i.e. to send and receive SMS from the same application. In order to do so, I have created a class that extends BroadcastReciever, implemented the onReceive() method, and declared the relevant permissions.

I verified the implementation by sending a SMS using telnet.
I want to automate the telnet process, i.e. having the application test itself by sending the SMS. In order to do so, I invoke the following method in the main activity, but the BroadcastReceiver is never called:

private final void sendSMS() {
    final TelephonyManager telMgr = (TelephonyManager)
            getSystemService(Context.TELEPHONY_SERVICE);
    final int len = telMgr.getLine1Number().length(); 
    final String phoneNum = telMgr.getLine1Number().substring(len - 4, len);
    final String msg = "msg"; 
    SmsManager.getDefault().sendTextMessage(phoneNum, null, msg, null, null);
}

Any clue what is wrong…?

UPDATE: Note that the code above is intended for the emulator.

  • 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-04T19:01:47+00:00Added an answer on June 4, 2026 at 7:01 pm

    Not sure if I understand you question right, but are you trying send an SMS from the emulator to itself? As far as I know, that is not possible. Just load up another emulator, and send messages between them.

    Since telnet commands work, your BroadcastReceiver is probably correctly implemented, but you should probably attach the code for it anyways… Its hard to troubleshoot code you can’t see 🙂

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

Sidebar

Related Questions

I have created two buttons in a gridview. I wish to achieve the following
I have started learning with Liferay 6.1 What I wish to achieve is: Displaying
I wish to send an email from my localhost machine (using PHPs mail function)
So, I have a particularly unique goal I wish to achieve with CSS, HTML
I have a Silverlight application that uses WCF services and also uses the Wintellect
I wish to create an ASP.NET web application that allows upload of files up
I wish to add a PMD check to ensure that a class does not
I wish to drag from one subview to another within my application (and connect
What i wish to achieve, is a jQuery image preloader, that loads a different
I have an XElement (myParent) containing multiple levels of children that I wish to

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.