Last time I introduced how to use the reflection mechanism of JAVA to call the hidden APIs of Bluetooth. This time I continued to practice the reflection mechanism of JAVA and explored several functions that TelephonyManager contains in the Framework but hidden in the SDK. Let's take a look at the program running in this article:
This program demonstrates the following functions:
1. All incoming calls are automatically answered;
2. All incoming call
The telephonymanager class provides a series of get methods for accessing the status and information related to mobile communication. The information includes the status and information of the mobile phone SIM, the status of the Telecom Network, and the information of the mobile phone user. In applications, you can use these get methods to obtain relevant data.
Objects of the telephonymanager class can use
This example describes the Telephonymanager usage in Android. Share to everyone for your reference, specific as follows:
First, overview:
The Telephonymanager class mainly provides a series of get methods for accessing state and information related to mobile communications. This includes the status and information of Mobile SIM, the status of telecom network and the information of mobile phone users. You
The reflection mechanism of Java, explore the Telephonymanager in the framework contains but in the SDK hidden several functions. Let's take a look at the effect of this program:
This program demonstrates the following features:
1. All incoming calls are automatically answered;
2. All incoming calls are automatically hung up;
3. Open/Close radio;
4. Turn on/Off data connections (WAP or net connections).
Calling Telephonymanager's Hidden API is
Telephonymanager This class is useful and can get a lot of information about mobile phones and SIM cards.Directly on the code after the comment, please enjoyPackage Net.sunniwell.app;Import android.app.Activity;Import Android.os.Bundle;Import android.telephony.CellLocation;Import Android.telephony.PhoneStateListener;Import Android.telephony.TelephonyManager;public class Telmanager extends Activity { @Overrideprotected void OnCreate (Bundle savedinstan
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
The examples in this article describe the methods of Telephonymanager classes in Android. Share to everyone for your reference. Specifically as follows:
The Telephonymanager class mainly provides a series of get methods for accessing state and information related to mobile communications. This includes the status and information of Mobile SIM, the status of telecom network and the information of mobile pho
This article from http://blog.csdn.net/hellogv/, reference must indicate the source!
Last time I introduced how to use the reflection mechanism of Java to call the hidden APIs of Bluetooth. This time I continued to practice the reflection mechanism of Java and explored several functions that telephonymanager contains in the framework but hidden in the SDK. Let's take a look at the program running in this article:
This program demonstrates the followi
}Super.oncallstatechanged (state, Incomingnumber);}}@Overrideprotected void OnCreate (Bundle savedinstancestate) {Super.oncreate (savedinstancestate);Setcontentview (R.layout.activity_block_main);Get the system's Telephonymanager ManagerTmanager = (Telephonymanager) getsystemservice (Context.telephony_service);Cplistener = new Customphonecalllistener ();Monitor the change of call status via Telephonymanager
1> Get TelephonyManagerTelephonyManager telMgr = (TelephonyManager) getSystemService (TELEPHONY_SERVICE );
2> Get SIM card statusTelMgr. getSimState ();
3> Get SIM card number
TelMgr. getSimSerialNumber ();
4> Get SIM card supplier number
TelMgr. getSimOperator ();
5> Get SIM card Supplier name
TelMgr. getSimOperatorName ();
6> obtain the country of the SIM card
TelMgr. getSimCountryIso ();
7> retrieve mobile phone type
TelMgr. getPhoneType ();
8> obt
This article analyzes the use of Telephonymanager classes in Android using case studies. Share to everyone for your reference. Specifically as follows:
Directory structure:
Main.xml Layout file:
Array.xml file:
Manifest file:
Telephonymanageractivity class:
Package com.ljq.activity;
Import java.util.ArrayList;
Import android.app.Activity;
Import Android.content.Context;
Import Android.os.Bundle;
Im
The previous article describes how to use the Java reflection mechanism to invoke the Bluetooth hidden API, this article continues to practice the Java reflection Mechanism, explore telephonymanager in the framework included in the SDK hidden in several functions.
Let's take a look at the effect diagram that this program runs as follows:
This program demonstrates the following features:
1. All incoming calls are automatically answered;
2. All in
Reprint Address: http://blog.csdn.net/sunxingzhesunjinbiao/article/details/7021328
AndroidAcquisition of the local number and SIM card status
Telephonymanager This class is useful and can get a lot of information about mobile phones and SIM cards.Immediately after the comment code, please enjoy
Package Net.sunniwell.app;Import Android. App. activity;Import android. Os. Bundle;Import Android. Telephony. Celllocation;Import Android. Telephony. Phon
Obtain the current network type (2g, 3g, 4g, wifi), mobile phone model, and version number of Android.Obtain the mobile phone model: android. OS. build. MODEL: android. OS. build. VERSION. the code used to obtain the current network type of the mobile phone is as follows: This is a tool class, which can be saved for easy use.
Package com. iqtogether. qxueyou. support. util; import android. content. context; import android.net. connectivityManager; import android.net. networkInfo; import android.
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.