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 8268023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:44:09+00:00 2026-06-08T05:44:09+00:00

I am writing an application that communicates with other devices through SMSs. I was

  • 0

I am writing an application that communicates with other devices through SMSs.

I was able to implement a listener for received SMSs. The thing is that it is listening to all received messages. I would like to only listen received SMSs from a specific number.

Here is my onReceive method.

@Override
public void onReceive(Context context, Intent intent) {
    // TODO Auto-generated method stub
    Bundle bundle = intent.getExtras();

    Object messages[] = (Object[]) bundle.get("pdus");
    SmsMessage smsMessage[] = new SmsMessage[messages.length];
    for (int n = 0; n < messages.length; n++) {
        smsMessage[n] = SmsMessage.createFromPdu((byte[]) messages[n]);
    }

    // show first message
    Toast toast = Toast.makeText(context,
                  "Received SMS: " + smsMessage[0].getMessageBody(),
                  Toast.LENGTH_LONG);
    toast.show();
}
  • 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-08T05:44:11+00:00Added an answer on June 8, 2026 at 5:44 am

    There is no way AFAIK to filter for a number just by the intent.

    What you CAN do is to get phone number in the Receiver like this:

    SMSMesssage msg=SMSMessage.creatFromPdu(pdu)
    String origination_no = msg.getDisplayOriginatingAddress()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am in the process of writing an application that communicates with several devices
I'm writing an application that communicates through the Windows RPC mechanism with a hosted
I'm writing an application that interacts with other processes on a x64 Vista machine.
I'm writing an application for the iPhone that communicates with a SQLite database but
I'm writing an application that communicates with the serial port to control a device.
I am writing an application that communicates with Active Directory and I need to
I am writing an application that communicates using sockets. I have a server running
I'm writing an application that communicates by sending bytes to the USB port. I'd
I'm writing a simple application that communicates with an external server. The server currently
I am writing a .NET application that can communicate with HID devices. I want

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.