Discover best call blocker for android without ringing, include the articles, news, trends, analysis and practical advice about best call blocker for android without ringing on alibabacloud.com
Logonrequiretask, landing running status hangs thread, wake up after landing.packagecom.idroid.requirement;importjava.util.concurrent.callable;import java.util.concurrent.executionexception;importjava.util.concurrent.executor;import java.util.concurrent.executors;importjava.util.concurrent.futuretask;importandroid.os.handler; Publicabstractclasslogonrequiretask{privatestaticvolatileexecutor sdefaultexecutor=executors.newsinglethreadexecutor ();p Rivatefinalstaticint sDefaultWaitLong=5*60*1000;p
Android call monitoring and power-off monitoring, android call monitoring
I think writing an article is useful, and I must have my own ideas. The following three questions will be taken into consideration about the call-to-power listening process:
1. What is the purpose of l
The example of this article is about the implementation of the Android monitor caller and power off. Share to everyone for your reference, specific as follows:
To monitor the Android phone and answer the phone, just the following 2 steps
The first step is to write a receiver inherited from Broadcastreceiver
Import Android.app.Service;
Import Android.content.BroadcastReceiver;
Import Android.content.C
buttons
Preferencescreen Prefset = Getpreferencescreen ();
Msubmenuvoicemailsettings = (editphonenumberpreference) findpreference (Button_voicemail_key);
。。。。。。。
。。。。。。。
So it's almost done. To get whether or not to open this function to store and remove to the system database, next is to Framework/base/policy/src/com/android
/internal/policy/impl under the
Phonewindowmanager.java, we've been analyzing the Phonewindowmanager.java.
public int
Knowledge points:
Android does not open an API for ending a call. to end a call, you must use AIDL to communicate with the telephone management service and call the API in the service to end the call. The method is as follows:1> copy the following files from the
Android obtains the phone status and listens to the phone call status, and android listens
Get Mobile Phone status:
Import android. content. context; import android. telephony. telephonyManager; // obtain the corresponding system service TelephonyManager tm = (TelephonyMana
Create a broadcast event receiver and register this file in the manifest file, filtering the intent toAndroid.intent.action.PHONE_STATEIn the IntelliJ because did not prompt thought that does not have this, actually has, increases the permissionAndroid.permission.READ_PHONE_STATE
android:name=".receiver.CallReceiver">
android:name="android.intent.action.PHONE_STATE"/>
android:name="android.permission
The realization of mobile phone status monitoring, mainly rely on two categories: Telephonemanger and Phonestatelistener.
Telephonsemanger provides a way to obtain information about the basic services of a mobile phone. So the application can use Telephonymanager to detect the basic service of the mobile phone. Applications can register listener to listen for changes to the phone's status. We cannot instantiate the Telephonymanager, only by getting the service in the form of:
Context.getsystemse
The basic idea of listening to the phone status on Android is to register and accept the broadcast of the phone status. The implementation is as follows:
First, you need the following permissions to listen to the phone status:
Second, accept the broadcast of phone status:
Public class phonereceiver extends broadcastreceiver {Private Static final string tag = "phonereceiver"; Public void onreceive (context, intent) {log. I (TAG, "onreceive ()"); st
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.