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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:41:47+00:00 2026-05-24T18:41:47+00:00

Hey guys I could really use some insight into this one. Ok, I’m new

  • 0

Hey guys I could really use some insight into this one. Ok, I’m new to eclipse and android first of all. Here is what I’ve got. Ok, I’ve got a BroadcastReceiver that I’m using to monitor text messages. When a text message comes in it grabs the from and message body and then passes them on to method FilterMessage() this then does a query against the database using the message body.

So far it compiles but when I send the Text it doesn’t trigger the BroadcastReceiver (doesn’t print to logcat) here is the code:

public class SMSReceiver extends BroadcastReceiver {
    SQLiteDatabase db;
    private static final String ACTION = "android.provider.Telephony.SMS_RECEIVED";
    private static String messagefrom;
    private static String messagebody;
    final String dbTable = "Realtor_SMS_Table";


    @Override
    public void onReceive(Context context, Intent intent) {

        if (intent != null && intent.getAction() != null && ACTION.compareToIgnoreCase(intent.getAction()) == 0) {
            Object[] pduArray = (Object[]) intent.getExtras().get("pdus");
                SmsMessage[] messages = new SmsMessage[pduArray.length];
                for (int i = 0; i < pduArray.length; i++) {
                    messages[i] = SmsMessage.createFromPdu((byte[])pduArray[i]);
                    messagefrom = messages[i].getOriginatingAddress();
                    messagebody = messages[i].getMessageBody();
                    Log.d("My SMSReceiver", "From: " + messagefrom);
                    Log.d("My SMSReceiver", "Msg: " + messagebody);
                    FilterMessage(dbTable, messagefrom, messagebody);

                }

                Log.d("My SMSReceiver", "SMSReceived");

        }
    }
    public void FilterMessage(String dbTable, String messagefrom, String messagebody) {

        DBHelper dbhelper = new DBHelper(null);
        SQLiteDatabase db = dbhelper.getReadableDatabase();
        Cursor cursor = db.query(dbTable, new String[] {"_id", "Description", "URL"}, 
                "_id like " + "'%" + messagebody + "%'", null, null, null, null);


        Log.d("My SMSReceiver", "sql= " +cursor);

        if (cursor != null) {
            cursor.moveToFirst();
            String messageAddress = null;
            String messageDescription = null;
            String messageURL = null;
            while (cursor.isAfterLast() == false){

                messageAddress = cursor.getString(0);
                messageDescription = cursor.getString(1);
                messageURL = cursor.getString(2);

            }
            SmsManager sm = SmsManager.getDefault();
            sm.sendTextMessage(messagefrom, null, messageAddress + messageDescription, null, null);
            sm.sendTextMessage(messagefrom, null, messageAddress + messageURL, null, null);
        }


    }


}

here is the AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.RealtorSMS" android:versionCode="1" android:versionName="1.0">
    <uses-sdk android:minSdkVersion="3" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.SEND_SMS" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".ActivationActivity" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>


        <receiver android:name=".SMSReceiver">
            <intent-filter>
                <action android:name="android.provider.telephony.SMS_RECEIVED"></action>
            </intent-filter>
        </receiver>



        <activity android:name=".PreferencesAcitvity" />
        <activity android:name=".ViewListingsActivity" />


    </application>
</manifest>
  • 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-24T18:41:49+00:00Added an answer on May 24, 2026 at 6:41 pm

    You need to use a capital T in your intent filter in the manifest:

    <action android:name="android.provider.Telephony.SMS_RECEIVED">
                                           ^
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guys, This could be a noob question, but I really can't find any
Hey guys, I could only find 1 thread on this, and it didn't really
Hey guys, what function could I use to say, if this radio button is
Hey guys quite new to smarty and was wondering if i could load templates
hey guys, i wonder how I could solve this in the best way: I
Hey guys, I couldn't really think of what to call this error in the
Hey guys this is my question If you go to 372designs.com and see one
Hey guys I was wondering how I could make the title of my website
Hey guys I was wondering if someone could provide a little help. I've been
Hey guys, I'm working on a project. I need to use the function cvFindHomography

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.