Skip to content

manumaticx/TelephonyManager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Titanium TelephonyManager gittio

Titanium Module for accessing the Android TelephonyManager

Description

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)

Quick Start

Installation

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

Usage

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_STATE permission 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

API Documentation

Properties

  • callState (Number)
    • CALL_STATE_RINGING
    • CALL_STATE_OFFHOOK
    • CALL_STATE_IDLE
  • dataActivity (Number)
    • DATA_ACTIVITY_NONE
    • DATA_ACTIVITY_IN
    • DATA_ACTIVITY_OUT
    • DATA_ACTIVITY_INOUT
    • DATA_ACTIVITY_DORMANT
  • dataState (Number)
    • DATA_DISCONNECTED
    • DATA_CONNECTING
    • DATA_CONNECTED
    • DATA_SUSPENDED
  • deviceId (String)
  • deviceSoftwareVersion (String)
  • groupIdLevel1 (String)
  • line1Number (String)
  • mmsUAProfUrl (String)
  • mmsUserAgent (String)
  • networkCountryIso (String)
  • networkOperator (String)
  • networkOperatorName (String)
  • networkType (Number)
    • NETWORK_TYPE_1xRTT
    • NETWORK_TYPE_CDMA
    • NETWORK_TYPE_EDGE
    • NETWORK_TYPE_EHRPD
    • NETWORK_TYPE_EVDO_0
    • NETWORK_TYPE_EVDO_A
    • NETWORK_TYPE_EVDO_B
    • NETWORK_TYPE_GPRS
    • NETWORK_TYPE_HSDPA
    • NETWORK_TYPE_HSPA
    • NETWORK_TYPE_HSPAP
    • NETWORK_TYPE_HSUPA
    • NETWORK_TYPE_IDEN
    • NETWORK_TYPE_LTE
    • NETWORK_TYPE_UMTS
    • NETWORK_TYPE_UNKNOWN
  • phoneType (Number)
    • PHONE_TYPE_NONE
    • PHONE_TYPE_GSM
    • PHONE_TYPE_CDMA
    • PHONE_TYPE_SIP
  • simCountryIso (String)
  • simOperator (String)
  • simOperatorName (String)
  • simSerialNumber (String)
  • simState (Number)
    • SIM_STATE_UNKNOWN
    • SIM_STATE_ABSENT
    • SIM_STATE_PIN_REQUIRED
    • SIM_STATE_PUK_REQUIRED
    • SIM_STATE_NETWORK_LOCKED
    • SIM_STATE_READY
  • subscriberId (String)
  • voiceMailAlphaTag (String)
  • voiceMailNumber (String)
  • hasCarrierPrivileges (Boolean)
  • hasIccCard (Boolean)
  • isNetworkRoaming (Boolean)
  • isSmsCapable (Boolean)
  • isVoiceCapable (Boolean)

Events

  • callForwardingIndicator
  • callState
  • cellInfo
  • cellLocation
  • dataActivity
  • dataConnectionState
  • messageWaitingIndicator
  • serviceState
  • signalStrengths

License

The MIT License (MIT)

About

Android TelephonyManager Module for Titanium

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published