Titanium Module for accessing the Android TelephonyManager
This module exposes the Android TelephonyManager to Titanium.
(If you are looking for something similar for iOS you should check out David Bankier's CoreTelephony module)
Download the latest distribution ZIP-file and consult the Titanium Documentation on how install it, or simply use the gitTio CLI:
$ gittio install com.goyya.telephonymanager
For the full API documentation please see here
var telephonymanager = require("com.goyya.telephonymanager");
// these are just some infos you can get
console.log('callState: ' + telephonymanager.callState);
console.log('deviceId: ' + telephonymanager.deviceId);
console.log('deviceSoftwareVersion: ' + telephonymanager.deviceSoftwareVersion);
console.log('phoneNumber: ' + telephonymanager.line1Number);
console.log('networkOperator: ' + telephonymanager.networkOperator);
console.log('networkOperatorName: ' + telephonymanager.networkOperatorName);
console.log('networkType: ' + telephonymanager.networkType);
console.log('phoneType: ' + telephonymanager.phoneType);
console.log('simOperator: ' + telephonymanager.simOperator);
console.log('simOperatorName: ' + telephonymanager.simOperatorName);
console.log('simSerialNumber: ' + telephonymanager.simSerialNumber);
console.log('simState: ' + telephonymanager.simState);
console.log('voiceMailNumber: ' + telephonymanager.voiceMailNumber);
console.log('isNetworkRoaming: ' + telephonymanager.isNetworkRoaming);
console.log('isSmsCapable: ' + telephonymanager.isSmsCapable);
console.log('isVoiceCapable: ' + telephonymanager.isVoiceCapable);NOTE: This module automatically adds the
READ_PHONE_STATEpermission to your manifest. If you are using methods of the TelephonyManager that are requiring any other permission, please add it manually to your tiapp.xml
callState(Number)CALL_STATE_RINGINGCALL_STATE_OFFHOOKCALL_STATE_IDLE
dataActivity(Number)DATA_ACTIVITY_NONEDATA_ACTIVITY_INDATA_ACTIVITY_OUTDATA_ACTIVITY_INOUTDATA_ACTIVITY_DORMANT
dataState(Number)DATA_DISCONNECTEDDATA_CONNECTINGDATA_CONNECTEDDATA_SUSPENDED
deviceId(String)deviceSoftwareVersion(String)groupIdLevel1(String)line1Number(String)mmsUAProfUrl(String)mmsUserAgent(String)networkCountryIso(String)networkOperator(String)networkOperatorName(String)networkType(Number)NETWORK_TYPE_1xRTTNETWORK_TYPE_CDMANETWORK_TYPE_EDGENETWORK_TYPE_EHRPDNETWORK_TYPE_EVDO_0NETWORK_TYPE_EVDO_ANETWORK_TYPE_EVDO_BNETWORK_TYPE_GPRSNETWORK_TYPE_HSDPANETWORK_TYPE_HSPANETWORK_TYPE_HSPAPNETWORK_TYPE_HSUPANETWORK_TYPE_IDENNETWORK_TYPE_LTENETWORK_TYPE_UMTSNETWORK_TYPE_UNKNOWN
phoneType(Number)PHONE_TYPE_NONEPHONE_TYPE_GSMPHONE_TYPE_CDMAPHONE_TYPE_SIP
simCountryIso(String)simOperator(String)simOperatorName(String)simSerialNumber(String)simState(Number)SIM_STATE_UNKNOWNSIM_STATE_ABSENTSIM_STATE_PIN_REQUIREDSIM_STATE_PUK_REQUIREDSIM_STATE_NETWORK_LOCKEDSIM_STATE_READY
subscriberId(String)voiceMailAlphaTag(String)voiceMailNumber(String)hasCarrierPrivileges(Boolean)hasIccCard(Boolean)isNetworkRoaming(Boolean)isSmsCapable(Boolean)isVoiceCapable(Boolean)
callForwardingIndicatorcallStatecellInfocellLocationdataActivitydataConnectionStatemessageWaitingIndicatorserviceStatesignalStrengths