Most visited

Recently visited

Added in API level 3

NeighboringCellInfo

public class NeighboringCellInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.telephony.NeighboringCellInfo


Represents the neighboring cell information, including Received Signal Strength and Cell ID location.

Summary

Constants

int UNKNOWN_CID

Cell location is not available

int UNKNOWN_RSSI

Signal strength is not available

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<NeighboringCellInfo> CREATOR

Public constructors

NeighboringCellInfo()

This constructor was deprecated in API level 5. by NeighboringCellInfo(int, String, int)

NeighboringCellInfo(int rssi, int cid)

This constructor was deprecated in API level 5. by NeighboringCellInfo(int, String, int)

NeighboringCellInfo(int rssi, String location, int radioType)

Initialize the object from rssi, location string, and radioType radioType is one of following TelephonyManager.NETWORK_TYPE_GPRS, TelephonyManager.NETWORK_TYPE_EDGE, TelephonyManager.NETWORK_TYPE_UMTS, TelephonyManager.NETWORK_TYPE_HSDPA, TelephonyManager.NETWORK_TYPE_HSUPA, and TelephonyManager.NETWORK_TYPE_HSPA.

NeighboringCellInfo(Parcel in)

Initialize the object from a parcel.

Public methods

int describeContents()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

int getCid()
int getLac()
int getNetworkType()
int getPsc()
int getRssi()
void setCid(int cid)

This method was deprecated in API level 5. cid value passed as in location parameter passed to constructor NeighboringCellInfo(int, String, int)

void setRssi(int rssi)

This method was deprecated in API level 5. initial rssi value passed as parameter to constructor NeighboringCellInfo(int, String, int)

String toString()

Returns a string representation of the object.

void writeToParcel(Parcel dest, int flags)

Flatten this object in to a Parcel.

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Constants

UNKNOWN_CID

Added in API level 3
int UNKNOWN_CID

Cell location is not available

Constant Value: -1 (0xffffffff)

UNKNOWN_RSSI

Added in API level 3
int UNKNOWN_RSSI

Signal strength is not available

Constant Value: 99 (0x00000063)

Fields

CREATOR

Added in API level 3
Creator<NeighboringCellInfo> CREATOR

Public constructors

NeighboringCellInfo

Added in API level 3
NeighboringCellInfo ()

This constructor was deprecated in API level 5.
by NeighboringCellInfo(int, String, int)

Empty constructor. Initializes the RSSI and CID. NeighboringCellInfo is one time shot for the neighboring cells based on the radio network type at that moment. Its constructor needs radio network type.

NeighboringCellInfo

Added in API level 3
NeighboringCellInfo (int rssi, 
                int cid)

This constructor was deprecated in API level 5.
by NeighboringCellInfo(int, String, int)

Initialize the object from rssi and cid. NeighboringCellInfo is one time shot for the neighboring cells based on the radio network type at that moment. Its constructor needs radio network type.

Parameters
rssi int
cid int

NeighboringCellInfo

Added in API level 7
NeighboringCellInfo (int rssi, 
                String location, 
                int radioType)

Initialize the object from rssi, location string, and radioType radioType is one of following TelephonyManager.NETWORK_TYPE_GPRS, TelephonyManager.NETWORK_TYPE_EDGE, TelephonyManager.NETWORK_TYPE_UMTS, TelephonyManager.NETWORK_TYPE_HSDPA, TelephonyManager.NETWORK_TYPE_HSUPA, and TelephonyManager.NETWORK_TYPE_HSPA.

Parameters
rssi int
location String
radioType int

NeighboringCellInfo

Added in API level 3
NeighboringCellInfo (Parcel in)

Initialize the object from a parcel.

Parameters
in Parcel

Public methods

describeContents

Added in API level 3
int describeContents ()

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(Parcel, int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getCid

Added in API level 3
int getCid ()

Returns
int cell id in GSM, 0xffff max legal value UNKNOWN_CID if in UMTS or CDMA or unknown

getLac

Added in API level 5
int getLac ()

Returns
int LAC in GSM, 0xffff max legal value UNKNOWN_CID if in UMTS or CMDA or unknown

getNetworkType

Added in API level 5
int getNetworkType ()

Returns
int Radio network type while neighboring cell location is stored. Return TelephonyManager.NETWORK_TYPE_UNKNOWN means that the location information is unavailable. Return TelephonyManager.NETWORK_TYPE_GPRS or TelephonyManager.NETWORK_TYPE_EDGE means that Neighboring Cell information is stored for GSM network, in which NeighboringCellInfo.getLac and NeighboringCellInfo.getCid should be called to access location. Return TelephonyManager.NETWORK_TYPE_UMTS, TelephonyManager.NETWORK_TYPE_HSDPA, TelephonyManager.NETWORK_TYPE_HSUPA, or TelephonyManager.NETWORK_TYPE_HSPA means that Neighboring Cell information is stored for UMTS network, in which NeighboringCellInfo.getPsc should be called to access location.

getPsc

Added in API level 5
int getPsc ()

Returns
int Primary Scrambling Code in 9 bits format in UMTS, 0x1ff max value UNKNOWN_CID if in GSM or CMDA or unknown

getRssi

Added in API level 3
int getRssi ()

Returns
int 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

setCid

Added in API level 3
void setCid (int cid)

This method was deprecated in API level 5.
cid value passed as in location parameter passed to constructor NeighboringCellInfo(int, String, int)

Set the cell id. NeighboringCellInfo is a one time shot for the neighboring cells based on the radio network type at that moment. It shouldn't be changed after creation.

Parameters
cid int

setRssi

Added in API level 3
void setRssi (int rssi)

This method was deprecated in API level 5.
initial rssi value passed as parameter to constructor NeighboringCellInfo(int, String, int)

Set the signal strength of the cell. NeighboringCellInfo is a one time shot for the neighboring cells based on the radio network type at that moment. It shouldn't be changed after creation.

Parameters
rssi int

toString

Added in API level 3
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 a string representation of the object.

writeToParcel

Added in API level 3
void writeToParcel (Parcel dest, 
                int flags)

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!