Android. some Classes in jar provide mobile phone-related information, such as Android. telephony. telephonymanager, android. OS. to view more information, go to frameworks to view more detailed class relationships. Copy a piece of code to briefly introduce some information about the mobile phone. The Code is as follows:
Import Java. util. locale; import android. app. activity; import android. content. context; import android. OS. build; import andro
Android gets SIM card carrier Information
Telephonymanager TM = (telephonymanager) Context. getsystemservice (context. telephony_service );Use of telephonymanagerTelephonymanager provides the entry for obtaining Communication Service Information on the device. The application uses this method to obtain the service provider or status of the phone. The program can also register a listener to listen for change
Add the phone call status to the Android phone and use phonestatelistener to listen.
Telephonymanager = (telephonymanager) context. getsystemservice (telephony_service); // start to listen to phonestatelistener phonelistener = new myphonestatelistener (); telephonymanager. listen (phonelistener, phonestatelistener. listen_call_state); // cancel listening to
Friends familiar with smartphones know one of the widely used mobile operating system Android open source mobile OS. So what should we do if we want to realize the listening function of the call in this system? Here is a detailed introduction to the Android listening to the relevant implementation of the call.
When developing an application, we want to be able to listen for incoming calls to perform operations such as pausing a music player, and then resuming playback when the phone is finished
Android Get SIM card operator informationTelephonymanager TM = (Telephonymanager) context.getsystemservice (Context.telephony_service); Telephonymanager uses Telephonymanager to provide access to information about the communication service on the device, and the application uses this class of methods to obtain a service provider or status for the phone. The progr
First, the android source code file neighboringcellinfo is required. aidl and itelephony. aidl: Create a folder named android. telephony (the file name must be this name), and the file neighboringcellinfo. copy aidl to this folder and create another folder COM. android. internal. telephony (name not required), put the file itelephony. place aidl In the refresh project directory. The corresponding class code is generated under the gen directory.
Project directory diagram:
The Code is as follows
Automatic suspension of incoming calls in the blacklist of Android Development
This instance allows you to dynamically add numbers to the blacklist and automatically stop blacklisted calls. The program creates a PhoneStateListener listener to monitor the call status of TelephonyManager.
Since Android 10 and later do not open APIs for hanging up the phone, you must use AIDL to communicate with the phone Management Service and call the API in the Servic
Http://marshal.easymorse.com/archives/1532
If you need to obtain mobile phone information through the android SDK. You can obtain this information as follows:
Telephonymanager=(Telephonymanager)This. Getsystemservice (context. telephony_service); string IMEI=Telephonymanager. getdeviceid ();
However, when writing this code, an error similar to h
lot of, but in the country as long as the three major operators of the network type probably on it.
Telecom
2G CDMA3G CDMA20004G Td-lte,fdd-lte
Move
2G GSM3G TD-SCDMA4G Td-lte,fdd-lte
Unicom
2G GSM3G WCDMA4G Td-lte,fdd-lte
The Google API provides us with 19 types, defined in the Telephonymanager class, as follows
/** network type is unknown * * public static final int network_type_unknown = 0;
/** Current Network is GPRS */public static f
We talked about cell phone, card-related number data including Imsi,msisdn,iccid,imei /*** * Get phone IMEI number @paramname *@return * @exception[Exception type] [exception description] *@see[Class, Class # method, Class # member] *@since[Which version starts with this method]*/ PublicString Getimei () {Telephonymanager Telephonymanager=(Telephonymanager
The Telephonymanager class provides a series of get methods for accessing status and information related to mobile communication. These include mobile SIM status and information, the status of the telecommunications network, and the information of mobile phone users. You can use these get methods in your application to get related data.Objects of the Telephonymanager class can be obtained by means of the Co
Call thread type
If there is a phone call, the blue code will be executed whether the phone is called or the phone is called in.
Telephonymanager. call_state_ringing: Incoming call status
Telephonymanager. call_state_offhook
Telephonymanager. call_state_idle: The status is monitored whether the phone is called or when the phone is called.
The Answer call will lis
Android determines the phone SIM statusPublic String readSIMCard (){TelephonyManager tm = (TelephonyManager) this. getSystemService (TELEPHONY_SERVICE); // obtain related system servicesStringBuffer sb = new StringBuffer ();Switch (tm. getSimState () {// getSimState () gets the sim in the following 6 states:Case TelephonyManager. SIM_STATE_ABSENT: sb. append ("no
the machine. Only when you contact the base station will the carrier assign you a number.
But I also wrote a class implementation to get the carrier
Layout file:
SIMCardInfo. java:
/*** @ Author yazhizhao * 20142014-10-22 9:13:04 */package com. example. android_sms; import android. content. context; import android. telephony. telephonyManager; import android. util. log;/*** @ author yazhizhao 9:13:04 */public class SIMCardInfo {/***
Mobile phone in production, each phone has a unique identification (ID), International use of International Mobile device Identification Code (IMEI, International Mobile Equipment identity). IMEI is a 15-digit "E-string", which corresponds to one by one of each phone, and the code is the only one in the world. Each handset will be given a globally unique set of numbers that will be recorded by the manufacturer of the manufacturing process, from production to delivery.In mobile application develo
After learning, has a general understanding of the development process of the Android program, in order to improve our interest in learning, in this section we will write a simple base station locator program. Now lbs (Location Based service, location-based services) mobile applications are quite popular (such as: micro-letters, customers, muttering, street, etc.), base station positioning is one of the key technologies used in such programs, let's uncover its mystery.
In this section, we will
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.