Saturday, September 29, 2012

TelephonyManager

TelephonyManager


java.lang.object
android.telephony.TelephonyManager

it provides access to the info about telephony services.
we can register services to receive notification of telephony state changes.


context.getSystemService(context.TELEPHONY_SERVICE);


SOME METHODS:

public int getCallState()-    get the call state

public cellLocation getCellLocation()- returns current location of the device.. returns null if the current location not available.

this requires permission in the manifest file.

what permissions we need to declare:

ACCESS_COARSE_LOCATION
ACCESS_FINE_LOCATION

some more methods:

we can get device id


public string getDeviceId()

we can get network operator

public string getNetworkOperator()


we can get sim operator name

public string getSimOperatorName()





0 comments:

Post a Comment