Telephonymanager and phoneinterfacemanager applications

Source: Internet
Author: User
Telephonymanager

The telephonymanager class provides a series of get methods for accessing the status and information related to mobile communication. Including the status and information of the phone SIM,

The status of the Telecom Network and the information of the mobile phone users. In the ApplicationProgramYou can use these get methods to obtain relevant data.

The telephonymanager class object can be passed through:The context. getsystemservice (context. telephony_service) method,

Note that some communication information is obtained.There are certain restrictions on the permissions of the application. You need to add the corresponding permissions to the application during development.

Telephonymanager is not a framework layer service, which belongs to the context and exists in every application.

Take a look at the telephonymanager class structure:

The service on the three framework layers is displayed. The remote proxy object obtains the status information.

Phoneinterfacemanager

Implement the itelephony interface, which is the related interface of the framework layer telephony to implement the phone control operation.

The implementation of this class is indeed completed in phoneapp, but the remote call is implemented and added

Servicemanager.

Phoneinterfacemanager constructor:

PrivatePhoneinterfacemanager (phoneapp app, phone) {Mapp=APP; mphone=Phone; MCM=Phoneapp. getinstance (). MCM; mmainthreadhandler=NewMainthreadhandler (); publish ();}Private VoidPublish () {servicemanager. addservice ("Phone",This);}

 

Telephonymanager and phoneinterfacemanager applications:

 

From: http://blog.163.com/my_ywj/blog/static/181203559201222384039340/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.