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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:31:03+00:00 2026-05-26T10:31:03+00:00

What I’ve done Hello Guys, I’m creating at the moment a SMS Broadcast Receiver,

  • 0

What I’ve done


Hello Guys, I’m creating at the moment a SMS Broadcast Receiver, i just builded one up with this tutorial: Broadcasttutorial. After I did the code, I updated my Manifest. After that I sent sms from my other Phone to my Phone, but It didn’t work. I didn’t get any output.

Question


What do I need to change, that I can receive those SMS. Please gimme a detailed anwser that I can learn it, a good tutorial would also be great!

Code


SMSBroadcastReceiver (is in package .services)

package de.retowaelchli.filterit.services;

import de.retowaelchli.filterit.R;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.util.Log;
import android.widget.Toast;


public class SmileySmsReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) 
    {
        //---get the SMS message passed in---
        Log.d("SmileySmsReceiver", "Yes it calls the onReceive");
        Bundle bundle = intent.getExtras();        
        SmsMessage[] msgs = null;
        String str = "";            
        if (bundle != null)
        {
            //---retrieve the SMS message received---
            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";        
            }
            //---display the new SMS message---
            Toast.makeText(context, str, Toast.LENGTH_SHORT).show();
        }                         
    }
}

This is my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="de.retowaelchli.filterit"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />

    <!--  User Permission -->
    <uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>  

    <application android:icon="@drawable/icon"
                 android:label="@string/app_name"
                 android:debuggable="true"
                 android:screenOrientation="sensor"
                 android:theme="@style/FilterIt.Theme"> 

        <activity android:name=".SplashScreenActivity"
                  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 -->
        <receiver android:name="de.retowaelchli.filterit.services.SmileySmsReceiver" android:enabled="true"> 
            <intent-filter> 
                <action android:name="android.provider.Telephony.SMS_RECEIVED" /> 
            </intent-filter> 
        </receiver>     



        <!--  Startseite -->
        <activity android:name=".StartseiteActivity"></activity>

        <!-- Von Startseite ausgehende Activitys -->   
        <activity android:name=".SmileyActivity"></activity>
        <activity android:name=".ADeleteActivity"></activity>
        <activity android:name=".StatsActivity"></activity>
        <activity android:name=".HelpMenuActivity"></activity>


        <!-- Von Stats ausgehende Activitys -->
        <activity android:name=".stats.ADFilterStats"></activity>
        <activity android:name=".stats.SFilterStats"></activity>
        <activity android:name=".stats.CreatedADFilters"></activity>
        <activity android:name=".stats.CreatedSFilters"></activity>

        <!-- Von ADeleteActivity ausgehende Activitys -->
        <activity android:name=".ADFilterConfigActivity"></activity>

        <!--  Von SmileyActivity ausgehende Activitys -->
        <activity android:name=".SFilterConfigActivity"></activity>

    </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-26T10:31:04+00:00Added an answer on May 26, 2026 at 10:31 am

    Put <uses-permission android:name="android.permission.RECEIVE_SMS" /> outside of the <application> tag:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="de.retowaelchli.filterit"
          android:versionCode="1"
          android:versionName="1.0">
        <uses-sdk android:minSdkVersion="10" />
    
        <uses-permission android:name="android.permission.RECEIVE_SMS" />
    
        <application android:icon="@drawable/icon"
                     android:label="@string/app_name"
                     android:debuggable="true"
                     android:screenOrientation="sensor"
                     android:theme="@style/FilterIt.Theme"> 
    
        <!-- Receiver -->
            <receiver android:name="de.retowaelchli.filterit.services.SmileySMSBroadcastReceiver"> 
                <intent-filter android:priority="999"> 
                    <action android:name="android.provider.Telephony.SMS_RECEIVED" /> 
                </intent-filter> 
            </receiver>
           …
           …
        </application>
    </manifest>
    

    UPDATE

    Turned out that @safari uses “Handcent SMS” application on his phone which intercepts incoming SMS (this is possible because SMS_RECEIVED is an ordered broadcast and can be canceled by high priority broadcast receivers, refer to this thread for details).
    To bypass this issue one would need to install broadcast receiver with higher priority than “Handcent SMS”. @safari used the highest priority allowed for applications in Android: 999, and it worked for him.
    To specify priority of broadcast receiver add android:priority attribute to corresponding <intent-filter> item:

    <receiver android:name="YourSmsBroadcastReceiver">
        <intent-filter android:priority="999"> 
            <action android:name="android.provider.Telephony.SMS_RECEIVED" /> 
        </intent-filter>
    </receiver>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
Specifically, suppose I start with the string string =hello \'i am \' me And
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

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.