"Received signal strength or UNKNOWN_RSSI if unknown. For GSM, it is
in "asu" ranging from 0 to 31 (dBm = -113 + 2*asu). 0 means "-113 dBm
or less" and 31 means "-51 dBm or greater". For UMTS, it is the Level
index of CPICH RSCP defined in TS 25.125."

So a developer expects to have 32 different values in the range of
[0-31], since there is nothing else about the granularity there.

It is true that on Android Developer Phone 1 (with Android 1.6) there
are only the 2, 6, 12 and 25 values as results.

This issue is quite similar to what is happening on Windows Mobile 6.1
OS on my HTC Toudh HD.
The function 
http://msdn.microsoft.com/en-us/library/microsoft.windowsmobile.status.systemstate.phonesignalstrength.aspx
gives only 0, 46, 74, 86, 100 values back.

Since the 2 hardware are almost identical, I suspect that is the
limitation of the hardware not the OS.

It would be good to get a clear answer from someone from Android,
because for me this is not acceptable:
> This is the way you get the signal strength.  The status bar uses the exact
> same information to show its bars.


---------- Replied message ----------
From: Dianne Hackborn <hack...@android.com>
Date: Apr 6, 11:29 pm
Subject: Android Telephony
To: Android Developers


This is the way you get the signal strength.  The status bar uses the
exact
same information to show its bars.



On Mon, Apr 6, 2009 at 1:18 PM, Matthew <matt...@troppertech.com>
wrote:

> Hello,

> I am new to this Group.

> Thank you for your recommendation to avoid using unsupported
> techniques.

> I am trying to obtain the signal strength seen by the G1 phone.

> As you had referred to, I have implemented a PhoneStateListener and
> onSignalStrengthChanged (int asu).

> It looks like I am seeing only a few  returned asu values (e.g., 2, 6,
> 12 and 25).

> I believe that the mapping of asu to dBm is as follows: -113dBm +
> 2*asu. Therefore, it looks like the G1 phone is reporting dBm values
> of -109, -101, -89 and -63.

> Also, I see that the signal strength icon used by the G1 has four bars
> (I am assuming that each bar corresponds to one of the 2, 6, 12 and 25
> asu values).

> Question: do you know if there is a supported way to obtain signal
> strength (either as an asu measure or a direct dBm measure) with a
> higher level
> of granularity (that is, for example, in single asu steps or single
> dBm steps)?

> Thank you in advance for any help or comments.

> On Mar 31, 3:40 am, Dianne Hackborn <hack...@android.com> wrote:
> > DO NOT DO THIS!!!

> > Especially since there is a public API for this:

> >http://developer.android.com/reference/android/telephony/PhoneStateLi...

> > We've been through the whole "don't use private APIs" stuff enough times,
> so
> > I'll just note:

> > 1. This is not "a bit of an advanced topic," this is outright hacking a
> > fragile kludge.
> > 2. Please do not recommend that people do this kind of stuff at least
> > without the relevant caveats that it is not a supported thing to do and
> they
> > can expect their app to break.
> > 3. Just because you get something to run on the current G1 today does not
> > mean it is the right thing to do.

> > On Thu, Mar 12, 2009 at 3:28 PM, <mark.ka...@gmail.com> wrote:

> > >   This can be done, but it is a bit of an advanced topic. You'll need
> > > to use an internal class which is
> > > com.android.internal.telephony.PhoneStateIntentReceiver

> > > Grab this package, the .class files  from the cupcake source tree
> > > repository , (doesn't ship with the SDK) and add the classes to you're
> > > class path, and include in the /libs directory, or package them into
> > > your existent android.jar file.

> > > Code to get the signal strength is as follows:

> > > import com.android.internal.telephony.PhoneStateIntentReceiver;
> > > private static final int EVENT_SIGNAL_STRENGTH_CHANGED = 200;
> > > ..
> > > /// first initialize the PhoneStateIntentReceiver (assumes you're
> > > inside a class that extends Context)

> > > void initPhoneStateReciever()
> > >    {
> > >       phoneStateReciever = new  PhoneStateIntentReceiver(this, new
> > > Handler( getMainLooper()));
> > >       phoneStateReciever.notifySignalStrength
> > > (EVENT_SIGNAL_STRENGTH_CHANGED);
> > >       phoneStateReciever.registerIntent();
> > >    }

> > > //to get the signal strength, use this method, or something similar

> > > void updateSignalStrength()
> > >   {
> > >           int signalDbm = phoneStateReciever.getSignalStrengthDbm();
> > >           int signalAsu = phoneStateReciever.getSignalStrength();
> > >          System.out.println("Time: "+System.currentTimeMillis()+"
> > > Signal Strength DB: "+signalDbm+" strength Asu: "+signalAsu);
> > >   }

> > > The use of internal classes is not officially supported, and you'll
> > > need to grab the .class files from the source repo, but I do actually
> > > have code that implements and is tested on the G1. Refer to other
> > > threads on options for getting the code and setting up your
> > > development environment to use internal classes. Good luck!

> > >                                   Mark

> > > On Mar 11, 7:49 am, Shrikant Agrawal <shrikant...@gmail.com> wrote:
> > > > Hi

> > > > I want to find the network signal strength for my app.
> > > > But I cant find the api for it.

> > > > Do anybody know how to find the signal strength of the phone?

> > > > Thanks

> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com

> > Note: please don't send private questions to me, as I don't have time to
> > provide private support.  All such questions should be posted on public
> > forums, where I and others can see and answer them.- Hide quoted text -

> > - Show quoted text -

--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time
to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can
see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to