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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:28:38+00:00 2026-06-07T08:28:38+00:00

I am new to Android programming and am trying to understand the concept of

  • 0

I am new to Android programming and am trying to understand the concept of BroadcastReceivers. In order to help myself, I am just trying to write a small application that monitors Wifi signal strength.

Now, from my understanding I can simply wait to receive the RSSI_CHANGED_ACTION broadcasted by the system. The RSSI should change frequently which means I should be receiving this notification frequently…however, never do I receive it once. I have watered my code down to the bare minimum so it just logs a message when the notification is received.

public class RssiActivity extends Activity {

    public BroadcastReceiver rssiReceiver = new BroadcastReceiver() {

        @Override
        public void onReceive(Context context, Intent intent) {
            // TODO Auto-generated method stub
            Log.d("Rssi", "RSSI changed");
        }
    };

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    @Override
    public void onResume() {
        super.onResume();
        registerReceiver(rssiReceiver, new IntentFilter(WifiManager.RSSI_CHANGED_ACTION));
        Log.d("Rssi", "Registered");
    }

    @Override
    public void onPause() {
        super.onPause();
        unregisterReceiver(rssiReceiver);
        Log.d("Rssi", "Unregistered");
    }
}

I have already seen this post Android: How to monitor WiFi signal strength and it doesn’t seem to help me. I have also tried the code sample here http://android-er.blogspot.com/2011/01/check-rssi-by-monitoring-of.html and it never updated the RSSI value either. I’m quite confused as to why this is. Any help you can give me would be greatly appreciated. Thanks!

  • 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-07T08:28:39+00:00Added an answer on June 7, 2026 at 8:28 am

    So, I had the same problem that you did, wanting to an updated RSSI value as the user walked around, etc, and I could not solve it using RSSI_CHANGED_ACTION.

    Like the issue you’re having, my callback would not be called correctly. Strangely, it was only called once, when the activity was created, and then never again.

    My Workaround

    In your onCreate(), register a callback for SCAN_RESULTS_AVAILABLE_ACTION. Then call WifiManager.startScan().

    Now, in your callback, do:

    WifiManager wifiMan=(WifiManager)getActivity().getSystemService(Context.WIFI_SERVICE);
    int newRssi = wifiMan.getConnectionInfo().getRssi();
    wifiMan.startScan();
    

    Now you have a loop, where the callback initiates a scan, receives the results, and initiates another scan.

    It’s gross and will suck a lot of power, however, you can watch the RSSI values change as you walk around.

    Full Code

    (note that I use onResume and onPause to register and unregister, so it will only scan repeatedly, e.g. waste battery, when the activity is onscreen)

    @Override
    public void onResume() {
        super.onResume();
        //Note: Not using RSSI_CHANGED_ACTION because it never calls me back.
        IntentFilter rssiFilter = new IntentFilter(WifiManager.SCAN_RESULTS_AVAILABLE_ACTION);
        this.registerReceiver(myRssiChangeReceiver, rssiFilter);
    
        WifiManager wifiMan=(WifiManager)getActivity().getSystemService(Context.WIFI_SERVICE);
        wifiMan.startScan();
    }
    
    
        @Override
    public void onPause() {
        super.onPause();
        this.unregisterReceiver(myRssiChangeReceiver);
    
    }
    /**
     * Broadcast receiver to update 
     */
    private BroadcastReceiver myRssiChangeReceiver
            = new BroadcastReceiver(){
        @Override
        public void onReceive(Context arg0, Intent arg1) {
            WifiManager wifiMan=(WifiManager)getActivity().getSystemService(Context.WIFI_SERVICE);
            wifiMan.startScan();
            int newRssi = wifiMan.getConnectionInfo().getRssi();
            Toast.makeText(getActivity(), ""+newRssi, Toast.LENGTH_SHORT).show();
    
    }};
    

    Sorry I’m so late, I just had to find out I had to solve your problem 😛

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

Sidebar

Related Questions

I'm new in Android Programming. I'm trying to write an app that uses USB
I'm still new to programming/Java/Android so I'm trying to understand everything I do and
I'm new to Android programming and trying to wrap my head around this just
I am new in Android Programming and I am trying to include GTalk application
I am trying to write a simple android application to help interpret some lab
i am new to android programming and i am trying to develop an app
I am new to android programming and i am trying to develop this app
I'm new to Android programming. I spent a long time trying to look for
I'm trying to make a tetris game for android to help learn game programming
I am new to android programming and trying to build a map activity app.

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.