SignalStrength

Kotlin | Java

public class SignalStrength

extends Object implements Parcelable

Contains phone signal strength related information.

Summary

Constants int INVALID Indicates the invalid measures of signal strength.

Inherited constants android.os.Parcelable From interface int CONTENTS_FILE_DESCRIPTOR Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor. int PARCELABLE_WRITE_RETURN_VALUE Flag for use with writeToParcel(Parcel, int) : the object being written is a return value, that is the result of a function such as " Parcelable someFunction() ", " void someFunction(out Parcelable) ", or " void someFunction(inout Parcelable) ".

Fields public static final Creator<SignalStrength> CREATOR Parcelable.Creator

Public methods int describeContents() Parcelable#describeContents boolean equals(Object o) Indicates whether some other object is "equal to" this one. int getCdmaDbm() This method was deprecated in API level 29. this information should be retrieved from CellSignalStrengthCdma#getCdmaDbm . int getCdmaEcio() This method was deprecated in API level 29. this information should be retrieved from CellSignalStrengthCdma#getCdmaEcio . <T extends CellSignalStrength> List<T> getCellSignalStrengths(Class<T> clazz) Returns a List of CellSignalStrength Components of this SignalStrength Report. List<CellSignalStrength> getCellSignalStrengths() Returns a List of CellSignalStrength Components of this SignalStrength Report. int getEvdoDbm() This method was deprecated in API level 29. this information should be retrieved from CellSignalStrengthCdma#getEvdoDbm . int getEvdoEcio() This method was deprecated in API level 29. this information should be retrieved from CellSignalStrengthCdma#getEvdoEcio . int getEvdoSnr() This method was deprecated in API level 29. this information should be retrieved from CellSignalStrengthCdma#getEvdoSnr . int getGsmBitErrorRate() This method was deprecated in API level 29. this information should be retrieved from CellSignalStrengthGsm#getBitErrorRate . int getGsmSignalStrength() This method was deprecated in API level 29. this information should be retrieved from CellSignalStrengthGsm#getAsuLevel . int getLevel() Retrieve an abstract level value for the overall signal strength. long getTimestampMillis()

Value is a non-negative timestamp in the SystemClock#elapsedRealtime() time base. int hashCode() Returns a hash code value for the object. boolean isGsm() This method was deprecated in API level 29. This method returns true if there are any 3gpp type SignalStrength elements in this SignalStrength report or if the report contains no valid SignalStrength information. Instead callers should use getCellSignalStrengths() to determine which types of information are contained in the SignalStrength report. String toString() Returns a string representation of the object. void writeToParcel(Parcel out, int flags) Parcelable#writeToParcel

Inherited methods java.lang.Object From class Object clone() Creates and returns a copy of this object. boolean equals(Object obj) Indicates whether some other object is "equal to" this one. void finalize() Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. final Class<?> getClass() Returns the runtime class of this Object . int hashCode() Returns a hash code value for the object. final void notify() Wakes up a single thread that is waiting on this object's monitor. final void notifyAll() Wakes up all threads that are waiting on this object's monitor. String toString() Returns a string representation of the object. final void wait(long timeout, int nanos) Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed. final void wait(long timeout) Causes the current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed. final void wait() Causes the current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object. android.os.Parcelable From interface abstract int describeContents() Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. abstract void writeToParcel(Parcel dest, int flags) Flatten this object in to a Parcel.

Constants

INVALID Added in API level 29 public static final int INVALID Indicates the invalid measures of signal strength. For example, this can be returned by getEvdoDbm() or getCdmaDbm() Constant Value: 2147483647 (0x7fffffff)

Fields

Public methods

describeContents Added in API level 7 public int describeContents () Parcelable#describeContents Returns int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or CONTENTS_FILE_DESCRIPTOR

equals Added in API level 7 public boolean equals (Object o) Indicates whether some other object is "equal to" this one. The equals method implements an equivalence relation on non-null object references: It is reflexive : for any non-null reference value x , x.equals(x) should return true .

: for any non-null reference value , should return . It is symmetric : for any non-null reference values x and y , x.equals(y) should return true if and only if y.equals(x) returns true .

: for any non-null reference values and , should return if and only if returns . It is transitive : for any non-null reference values x , y , and z , if x.equals(y) returns true and y.equals(z) returns true , then x.equals(z) should return true .

: for any non-null reference values , , and , if returns and returns , then should return . It is consistent : for any non-null reference values x and y , multiple invocations of x.equals(y) consistently return true or consistently return false , provided no information used in equals comparisons on the objects is modified.

: for any non-null reference values and , multiple invocations of consistently return or consistently return , provided no information used in comparisons on the objects is modified. For any non-null reference value x , x.equals(null) should return false . The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y , this method returns true if and only if x and y refer to the same object ( x == y has the value true ). Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes. Parameters o Object : the reference object with which to compare. Returns boolean true if the signal strengths are the same

getCdmaDbm

Deprecated in Added in API level 7 Deprecated in API level 29 public int getCdmaDbm () This method was deprecated in API level 29.

this information should be retrieved from CellSignalStrengthCdma#getCdmaDbm . Get the CDMA RSSI value in dBm Returns int the CDMA RSSI value or INVALID if invalid See also: android.telephony

getCellSignalStrengths()

getCdmaEcio

Deprecated in Added in API level 7 Deprecated in API level 29 public int getCdmaEcio () This method was deprecated in API level 29.

this information should be retrieved from CellSignalStrengthCdma#getCdmaEcio . Get the CDMA Ec/Io value in dB*10 Returns int See also: android.telephony

getCellSignalStrengths()

getCellSignalStrengths Added in API level 29 public List<T> getCellSignalStrengths (Class<T> clazz) Returns a List of CellSignalStrength Components of this SignalStrength Report. Use this API to access underlying CellSignalStrength objects that provide more granular information about the SignalStrength report. Only valid (non-empty) CellSignalStrengths will be returned. The order of any returned elements is not guaranteed, and the list may contain more than one instance of a CellSignalStrength type. Parameters clazz Class : a class type that extends CellSignalStrength to filter possible return values. This value cannot be null . Returns List<T> a List of CellSignalStrength or an empty List if there are no valid measurements. This value cannot be null . See also: android.telephony

android.telephony

android.telephony

android.telephony

android.telephony

android.telephony

android.telephony

getCellSignalStrengths Added in API level 29 public List<CellSignalStrength> getCellSignalStrengths () Returns a List of CellSignalStrength Components of this SignalStrength Report. Use this API to access underlying CellSignalStrength objects that provide more granular information about the SignalStrength report. Only valid (non-empty) CellSignalStrengths will be returned. The order of any returned elements is not guaranteed, and the list may contain more than one instance of a CellSignalStrength type. Returns List<CellSignalStrength> a List of CellSignalStrength or an empty List if there are no valid measurements. This value cannot be null . See also: android.telephony

android.telephony

android.telephony

android.telephony

android.telephony

android.telephony

android.telephony

getEvdoDbm

Deprecated in Added in API level 7 Deprecated in API level 29 public int getEvdoDbm () This method was deprecated in API level 29.

this information should be retrieved from CellSignalStrengthCdma#getEvdoDbm . Get the EVDO RSSI value in dBm Returns int the EVDO RSSI value or INVALID if invalid See also: android.telephony

getCellSignalStrengths()

getEvdoEcio

Deprecated in Added in API level 7 Deprecated in API level 29 public int getEvdoEcio () This method was deprecated in API level 29.

this information should be retrieved from CellSignalStrengthCdma#getEvdoEcio . Get the EVDO Ec/Io value in dB*10 Returns int See also: android.telephony

getCellSignalStrengths()

getEvdoSnr

Deprecated in Added in API level 7 Deprecated in API level 29 public int getEvdoSnr () This method was deprecated in API level 29.

this information should be retrieved from CellSignalStrengthCdma#getEvdoSnr . Get the signal to noise ratio. Valid values are 0-8. 8 is the highest. Returns int See also: android.telephony

getCellSignalStrengths()

getGsmBitErrorRate

Deprecated in Added in API level 7 Deprecated in API level 29 public int getGsmBitErrorRate () This method was deprecated in API level 29.

this information should be retrieved from CellSignalStrengthGsm#getBitErrorRate . Get the GSM bit error rate (0-7, 99) as defined in TS 27.007 8.5 Returns int See also: android.telephony

getCellSignalStrengths()

getGsmSignalStrength

Deprecated in Added in API level 7 Deprecated in API level 29 public int getGsmSignalStrength () This method was deprecated in API level 29.

this information should be retrieved from CellSignalStrengthGsm#getAsuLevel . Get the GSM RSSI in ASU. Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69 Returns int RSSI in ASU 0..31, 99, or UNAVAILABLE See also: android.telephony

getCellSignalStrengths()

getLevel Added in API level 23 public int getLevel () Retrieve an abstract level value for the overall signal strength. Returns int a single integer from 0 to 4 representing the general signal quality. This may take into account many different radio technology inputs. 0 represents very poor signal strength while 4 represents a very strong signal strength.

Added in API level 30 public long getTimestampMillis ()

Value is a non-negative timestamp in the SystemClock#elapsedRealtime() time base. Returns long timestamp in milliseconds since boot for SignalStrength . This timestamp reports the approximate time that the signal was measured and reported by the modem. It can be used to compare the recency of SignalStrength instances. Value is a non-negative timestamp in the SystemClock#elapsedRealtime() time base.

hashCode Added in API level 7 public int hashCode () Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap . The general contract of hashCode is: Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.

method must consistently return the same integer, provided no information used in comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.

method, then calling the method on each of the two objects must produce the same integer result. It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables. As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the Java™ programming language.) Returns int hash code

isGsm

Deprecated in Added in API level 7 Deprecated in API level 29 public boolean isGsm () This method was deprecated in API level 29.

This method returns true if there are any 3gpp type SignalStrength elements in this SignalStrength report or if the report contains no valid SignalStrength information. Instead callers should use getCellSignalStrengths() to determine which types of information are contained in the SignalStrength report. Returns boolean true if this is for GSM

toString Added in API level 7 public String toString () Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character ` @ ', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode()) Returns String string representation.