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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:08:25+00:00 2026-05-26T01:08:25+00:00

I need to launch an application when an SMS is received only from the

  • 0

I need to launch an application when an SMS is received only from the certain number and on the certain port. If the application is already run I need to parse this message. How can I do that using PendingIntent?

  • 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-05-26T01:08:26+00:00Added an answer on May 26, 2026 at 1:08 am

    First make the broadcastreceiver class which receive a message like this.
    and fire the intent of your class when sms is received.

       class SMSReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
        Bundle bundle = intent.getExtras();
        SmsMessage[] msgs = null;
        String str = "";
        if (bundle != null) {
          Object[] pdus = (Object[]) bundle.get("pdus");
          msgs = new SmsMessage[pdus.length];
          for (int i = 0; i < msgs.length; i++) {
            msgs[i] = SmsMessage.createFromPdu((byte[]) pdus[i]);
            str += "SMS from " + msgs[i].getOriginatingAddress();
            str += " :";
            str += msgs[i].getMessageBody().toString();
            str += "\n";
          }
          Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
          Intent mainActivityIntent = new Intent(context, SMS.class);
          mainActivityIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          context.startActivity(mainActivityIntent);
          Intent broadcastIntent = new Intent();
          broadcastIntent.setAction("SMS_RECEIVED_ACTION");
          broadcastIntent.putExtra("sms", str);
          context.sendBroadcast(broadcastIntent);
        }
      }
    }
    

    store the sms_sender in a string as

      String msg_sender=msg[0].getOriginatingAddress();
    

    and give the condition after receiving message that

       if(msg_sender=(String)"your_unique_number")
       and fire the intent of your class if this condition is true.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to launch an external application from a Google Chrome extension. I need
I need to launch activities such as camera from my application.I am unable to
I need to launch a modal window from a plugin in a video application.
I've found a need to launch a WPF application from inside a c# program.
I need to launch command prompt from my application and set arguments for it.
I'm doing a Java Record/Replay tool and I need to launch Java applications from
I need to launch a server on the remote machine and retrieve the port
I need to launch a media file from a URL from within my c#
I need to launch a number of long-running processes with subprocess.Popen , and would
for e.g from command prompt I need to launch the exe with some switch

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.