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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:42:51+00:00 2026-05-16T01:42:51+00:00

I have written an android app which listens to the phone signal strength using

  • 0

I have written an android app which listens to the phone signal strength using PhoneStateListener.SignalStrengthChanged(int asu). The app works perfectly with Android 1.6 and lower, but not with higher versions since onSignalStrengthChanged(int asu) has been deprecated and replaced with onSignalStrengthsChanged(SignalStrength signalStrength).

To make the app compatible with Android 2.0 and above, I have upgraded the app to use the 2.1 API and overridden PhoneStateListener.onSignalStrengthsChanged(SignalStrength signalStrength). I’m testing on a EVO with Android 2.1. The phone type (TelephonyManager.getPhoneType) is CDMA and TelephonyManager.getNetworkType returns “EVDO_A”. On this setup, onSignalStrengthsChanged(SignalStrength signalStrength) is never called, but SignalStrengthChanged(int asu) is, but this always returns a signal strength of -1 asu because its been depecated. I need to get the onSignalStrengthsChanged(SignalStrength signalStrength) to work…. does anyone know what I’m doing wrong?

Here’s the code:

mSignalListener = new PhoneStateListener(){
  @Override
    public void onSignalStrengthChanged(int asu){
      Log.d(Utils.LOGTAG, "#1. " + String.valueOf(asu));
      if (mStrength != asu){
        mStrength = asu;
        NotifyUI();
      }
      super.onSignalStrengthChanged(asu);
    }

  @Override
  public void onSignalStrengthsChanged(SignalStrength signalStrength) {
    Log.d(Utils.LOGTAG, "#2.");

    if (signalStrength.isGsm())
      mStrength = signalStrength.getGsmSignalStrength();
    else{
      int strength = -1;
      if (signalStrength.getEvdoDbm() < 0)
        strength = signalStrength.getEvdoDbm();
      else if (signalStrength.getCdmaDbm() < 0)
        strength = signalStrength.getCdmaDbm();

      if (strength < 0){
        // convert to asu
        mStrength = Math.round((strength + 113f) / 2f);
      }

      NotifyUI();
    }               
    super.onSignalStrengthsChanged(signalStrength);
  }
};

mTelManager = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
mTelManager.listen(mSignalListener, PhoneStateListener.LISTEN_SIGNAL_STRENGTH);
  • 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-16T01:42:51+00:00Added an answer on May 16, 2026 at 1:42 am

    I suppose you just register the mSignalListener for PhoneStateListener.LISTEN_SIGNAL_STRENGTHS as well? ((:

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

Sidebar

Related Questions

I have written an app which streaming video using HLS streaming to android 4
I've just written a short Android app which stores userdata in the phone-side sqlite
I have an android app, written in java which uses AsyncTask to download data.
I've written an Android app which various abstract classes that perform useful functions. These
I have written an Android application that uses SQLite database which is saved in
I have an android app which asks a question followed by x number of
I have written an android app that saves (potentially) large files to the SD
I've been asked for some review copies of an Android app I've written, which
I'm writing an Android app, in which I have several buttons laid out in
I have an android app written in java. The app basically connects to a

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.