Added in API level 1
Deprecated in API level 31

CellLocation


public abstract class CellLocation
extends Object

java.lang.Object
   ↳ android.telephony.CellLocation
CdmaCellLocation This class was deprecated in API level 31. use CellIdentity. 
GsmCellLocation This class was deprecated in API level 31. use CellIdentity. 


This class was deprecated in API level 31.
use CellIdentity.

Abstract class that represents the location of the device.

Summary

Public constructors

CellLocation()

Public methods

static CellLocation getEmpty()

Return a new CellLocation object representing an unknown location, or null for unknown/none phone radio types.

static void requestLocationUpdate()

This method is deprecated. use TelephonyManager.requestCellInfoUpdate.

Inherited methods

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 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 wait(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 wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

CellLocation

public CellLocation ()

Public methods

getEmpty

Added in API level 1
public static CellLocation getEmpty ()

Return a new CellLocation object representing an unknown location, or null for unknown/none phone radio types.

Returns
CellLocation

requestLocationUpdate

Added in API level 1
public static void requestLocationUpdate ()

This method is deprecated.
use TelephonyManager.requestCellInfoUpdate.

Request an updated CellLocation for callers targeting SDK 30 or older. Whenever Android is aware of location changes, a callback will automatically be sent to all registrants of PhoneStateListener.LISTEN_CELL_LOCATION. This API requests an additional location update for cases where power saving might cause location updates to be missed.

This method is a no-op for callers targeting SDK level 31 or greater.

This method is a no-op for callers that target SDK level 29 or 30 and lack Manifest.permission.ACCESS_FINE_LOCATION.

This method is a no-op for callers that target SDK level 28 or below and lack Manifest.permission.ACCESS_COARSE_LOCATION.