Articles

Affichage des articles associés au libellé TelephonyManager

Android tutorial : Managing phone calls

Image
Most Android devices, if not all, are phones. So their users expect to be able to call and receive calls. Android lets you handle the phone like any other component of the system. Calling To make a call from an application, using for example a number that you got from your own web service, create a DIAL ACTION intent with Uri of the form tel: NNNNN (where NNNNN is the phone number call) and use this intention with startActivity (). This does not initiate the call, but the activity will activate the handset, from which the user can then press a button to make the call. The manager use the  TelephonyManager class, which allows to:   ● determine whether the phone is in use, via  getCallState () method, which returns :  CALL STATE IDLE (phone not used),  CALL STATE RINGING (connection on a call)  CALL STATE OFFHOOK (on a call); ● find the identifier of the SIM card with getSubscriberId (); ● know the type of phone (GSM, for example) with getPhoneType () or that of the c