有没有Android来电自动接听?
Is there anyway to pick up the incoming call Automatically in Android?
我正在开发一个项目,我想在一定时间间隔后自动接听来电,播放音频文件并记录对话分钟。
由于我已成功实施 Callreciever 函数,我可以在其中检测到 phone.
的当前呼叫状态
CallReciever.Java
package com.example.deepdepindersingh.activevoice;
import android.content.Context;
import android.widget.Toast;
import java.util.Date;
/**
* Created by Deep Depinder Singh on 8/21/2016.
*/
public class CallReceiver extends PhonecallReceiver {
@Override
// call comming
protected void onIncomingCallStarted(Context ctx, String number, Date start) {
Toast.makeText(ctx, number , Toast.LENGTH_SHORT).show();
}
@Override
//Call picked by me
protected void onOutgoingCallStarted(Context ctx, String number, Date start) {
Toast.makeText(ctx, number , Toast.LENGTH_SHORT).show();
}
@Override
// Call ended by me
protected void onIncomingCallEnded(Context ctx, String number, Date start, Date end) {
Toast.makeText(ctx, number , Toast.LENGTH_SHORT).show();
}
@Override
protected void onOutgoingCallEnded(Context ctx, String number, Date start, Date end) {
}
@Override
protected void onMissedCall(Context ctx, String number, Date start) {
Toast.makeText(ctx, number , Toast.LENGTH_SHORT).show();
}
}
它实际上是自动应答,是的,可以在 android 中自动接听电话,为此您必须使用 autoanswer 中提供的这些代码。我认为它会对您有所帮助,这是完成您的任务的完整教程。
我正在开发一个项目,我想在一定时间间隔后自动接听来电,播放音频文件并记录对话分钟。 由于我已成功实施 Callreciever 函数,我可以在其中检测到 phone.
的当前呼叫状态CallReciever.Java
package com.example.deepdepindersingh.activevoice;
import android.content.Context;
import android.widget.Toast;
import java.util.Date;
/**
* Created by Deep Depinder Singh on 8/21/2016.
*/
public class CallReceiver extends PhonecallReceiver {
@Override
// call comming
protected void onIncomingCallStarted(Context ctx, String number, Date start) {
Toast.makeText(ctx, number , Toast.LENGTH_SHORT).show();
}
@Override
//Call picked by me
protected void onOutgoingCallStarted(Context ctx, String number, Date start) {
Toast.makeText(ctx, number , Toast.LENGTH_SHORT).show();
}
@Override
// Call ended by me
protected void onIncomingCallEnded(Context ctx, String number, Date start, Date end) {
Toast.makeText(ctx, number , Toast.LENGTH_SHORT).show();
}
@Override
protected void onOutgoingCallEnded(Context ctx, String number, Date start, Date end) {
}
@Override
protected void onMissedCall(Context ctx, String number, Date start) {
Toast.makeText(ctx, number , Toast.LENGTH_SHORT).show();
}
}
它实际上是自动应答,是的,可以在 android 中自动接听电话,为此您必须使用 autoanswer 中提供的这些代码。我认为它会对您有所帮助,这是完成您的任务的完整教程。