Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/telephony/NeighboringCellInfo#constants) \| [Inherited Constants](https://developer.android.com/reference/android/telephony/NeighboringCellInfo#inhconstants) \| [Fields](https://developer.android.com/reference/android/telephony/NeighboringCellInfo#lfields) \| [Ctors](https://developer.android.com/reference/android/telephony/NeighboringCellInfo#pubctors) \| [Methods](https://developer.android.com/reference/android/telephony/NeighboringCellInfo#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/telephony/NeighboringCellInfo#inhmethods)

# NeighboringCellInfo

*** ** * ** ***

` public class NeighboringCellInfo `   
` extends https://developer.android.com/reference/java/lang/Object ` ` implements https://developer.android.com/reference/android/os/Parcelable `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.telephony.NeighboringCellInfo |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 29.**   

This class should not be used by any app targeting `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` or higher. Instead callers should use `https://developer.android.com/reference/android/telephony/CellInfo`.

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

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#UNKNOWN_CID` Cell location is not available |
| `int` | `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#UNKNOWN_RSSI` Signal strength is not available |

### Inherited constants

From interface `https://developer.android.com/reference/android/os/Parcelable` `int` `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR`

Descriptor bit used with `https://developer.android.com/reference/android/os/Parcelable#describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.
`int` `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`

Flag for use with `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`: 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 https://developer.android.com/reference/android/os/Parcelable.Creator<https://developer.android.com/reference/android/telephony/NeighboringCellInfo>` | `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#CREATOR` <br /> |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo()() ` *This constructor is deprecated. by `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)`* |
| ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(android.os.Parcel)(https://developer.android.com/reference/android/os/Parcel in) ` Initialize the object from a parcel. |
| ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20int)(int rssi, int cid) ` *This constructor is deprecated. by `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)`* |
| ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)(int rssi, https://developer.android.com/reference/java/lang/String location, int radioType) ` Initialize the object from rssi, location string, and radioType radioType is one of following `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_GPRS`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EDGE`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_UMTS`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSDPA`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSUPA`, and `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSPA`. |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#describeContents()() ` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| ` int` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#getCid()() ` |
| ` int` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#getLac()() ` |
| ` int` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#getNetworkType()() ` |
| ` int` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#getPsc()() ` |
| ` int` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#getRssi()() ` |
| ` void` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#setCid(int)(int cid) ` *This method was deprecated in API level 15. cid value passed as in location parameter passed to constructor `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)`* |
| ` void` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#setRssi(int)(int rssi) ` *This method was deprecated in API level 15. initial rssi value passed as parameter to constructor `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)`* |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#toString()() ` Returns a string representation of the object. |
| ` void` | ` https://developer.android.com/reference/android/telephony/NeighboringCellInfo#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) ` Flatten this object in to a Parcel. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.
From interface ` https://developer.android.com/reference/android/os/Parcelable ` ` abstract int` ` https://developer.android.com/reference/android/os/Parcelable#describeContents()() `

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.
` abstract void` ` https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)(https://developer.android.com/reference/android/os/Parcel dest, int flags) `

Flatten this object in to a Parcel.

## Constants

### UNKNOWN_CID

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int UNKNOWN_CID
```

Cell location is not available

<br />

Constant Value: -1 (0xffffffff)

### UNKNOWN_RSSI

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int UNKNOWN_RSSI
```

Signal strength is not available

<br />

Constant Value: 99 (0x00000063)

## Fields

### CREATOR

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final Creator<NeighboringCellInfo> CREATOR
```

<br />

<br />

## Public constructors

### NeighboringCellInfo

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public NeighboringCellInfo ()
```

<br />

**This constructor is deprecated.**   

by `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)`

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.

<br />

### NeighboringCellInfo

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public NeighboringCellInfo (Parcel in)
```

Initialize the object from a parcel.

<br />

| Parameters ||
|---|---|
| `in` | `Parcel` <br /> |

### NeighboringCellInfo

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public NeighboringCellInfo (int rssi, 
                int cid)
```

<br />

**This constructor is deprecated.**   

by `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)`

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.

<br />

| Parameters ||
|---|---|
| `rssi` | `int` <br /> |
| `cid` | `int` <br /> |

### NeighboringCellInfo

Added in [API level 7](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public NeighboringCellInfo (int rssi, 
                String location, 
                int radioType)
```

Initialize the object from rssi, location string, and radioType radioType is one of following `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_GPRS`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EDGE`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_UMTS`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSDPA`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSUPA`, and `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSPA`.

<br />

| Parameters ||
|---|---|
| `rssi` | `int` <br /> |
| `location` | `String` <br /> |
| `radioType` | `int` <br /> |

## Public methods

### describeContents

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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 `https://developer.android.com/reference/android/os/Parcelable#writeToParcel(android.os.Parcel,%20int)`, the return value of this method must include the `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` bit.

<br />

| Returns ||
|---|---|
| `int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `https://developer.android.com/reference/android/os/Parcelable#CONTENTS_FILE_DESCRIPTOR` |

### getCid

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getCid ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | cell id in GSM, 0xffff max legal value UNKNOWN_CID if in UMTS or CDMA or unknown <br /> |

### getLac

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getLac ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | LAC in GSM, 0xffff max legal value UNKNOWN_CID if in UMTS or CMDA or unknown <br /> |

### getNetworkType

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getNetworkType ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | Radio network type while neighboring cell location is stored. Return `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_UNKNOWN` means that the location information is unavailable. Return `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_GPRS` or `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_EDGE` means that Neighboring Cell information is stored for GSM network, in which `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#getLac()` and `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#getCid()` should be called to access location. Return `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_UMTS`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSDPA`, `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSUPA`, or `https://developer.android.com/reference/android/telephony/TelephonyManager#NETWORK_TYPE_HSPA` means that Neighboring Cell information is stored for UMTS network, in which `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#getPsc()` should be called to access location. <br /> |

### getPsc

Added in [API level 5](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getPsc ()
```

<br />

<br />

| Returns ||
|---|---|
| `int` | Primary Scrambling Code in 9 bits format in UMTS, 0x1ff max value UNKNOWN_CID if in GSM or CMDA or unknown <br /> |

### getRssi

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getRssi ()
```

<br />

<br />

| 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 <br /> |

### setCid

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setCid (int cid)
```

<br />

**This method was deprecated in API level 15.**   

cid value passed as in location parameter passed to constructor `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)`

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.

<br />

| Parameters ||
|---|---|
| `cid` | `int` <br /> |

### setRssi

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 15](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setRssi (int rssi)
```

<br />

**This method was deprecated in API level 15.**   

initial rssi value passed as parameter to constructor `https://developer.android.com/reference/android/telephony/NeighboringCellInfo#NeighboringCellInfo(int,%20java.lang.String,%20int)`

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.

<br />

| Parameters ||
|---|---|
| `rssi` | `int` <br /> |

### toString

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |

### writeToParcel

Added in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void writeToParcel (Parcel dest, 
                int flags)
```

Flatten this object in to a Parcel.

<br />

| Parameters ||
|---|---|
| `dest` | `Parcel`: The Parcel in which the object should be written. This value cannot be `null`. <br /> |
| `flags` | `int`: Additional flags about how the object should be written. May be 0 or `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `https://developer.android.com/reference/android/os/Parcelable#PARCELABLE_WRITE_RETURN_VALUE` |