简体   繁体   English

Android:当有特定号码拨打电话时,如何自动接听?

[英]Android: howto pick up automatically when a certain number calls?

I want to create a program for Android which picks up automatically when a certain number calls and answer with dtmf tone. 我想为Android创建一个程序,当某个号码呼叫并以dtmf音接听时自动接听。 Is this possible in Android Java? Android Java中有可能吗?

If you just wanted to be aware that a certain number had called and then do some non call action, such as log the call, send a notification to a server etc then you can simply use the Android TelephonyManager () and create a BroadcastReceiver to listen for incoming call events. 如果您只是想知道某个号码已被呼叫,然后执行一些非呼叫操作,例如记录呼叫,向服务器发送通知等,则可以简单地使用Android TelephonyManager()并创建BroadcastReceiver来监听用于来电事件。 There are quite a few examples of how to use it to detect incoming calls available with a quick search. 关于如何使用它来检测快速搜索中可用的传入呼叫,有很多示例。

If you want to actually answer the call then strictly speaking in 'standard' Android terms you can't. 如果您想实际接听电话,那么严格说来,您不能使用“标准” Android术语。 However, take a look at this excellent answer (not mine...) for some workarounds which may possibly work for you depending on your particular solution (whether your target devices are rooted etc): 但是,请看以下出色的答案(不是我的...),这取决于您的特定解决方案(无论您的目标设备是否已植根等等),可能对您有用的一些解决方法:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 自动选择第一个手机号码 HintRequest android - Pick First mobile number automatically HintRequest android Android MapsUtils-拾取地图上的位置并单击 - Android MapsUtils - pick up location on map click Eclipse Tomcat可以自动在公共项目中拾取添加的文件吗? - Can Eclipse Tomcat automatically pick up added files in common project? Java:如何在满足特定条件时排队要执行的异步调用? - Java: How can I queue up asynchronous calls to be executed when a certain condition is met? 如何将每个数字打印到一定数量 - How to print each number up to a certain number 按下Button时选择Contacts onClick - Pick Contacts onClick when Button is pressed Android 适用于Android的Gradle:javaexec为什么不选择我的类路径? - Gradle for Android: Why doesn't javaexec pick up my classpath? 如何设置 RestTemplate 以重试某些响应状态代码的调用? - How to set up RestTemplate to retry calls on certain response status code? 如果输入特定数字,如何弹出特定窗口 - How to make a certain window pop up if a certain number is put in 如何让 Hibernate Interceptor 获取某些超类字段? - How do I get a Hibernate Interceptor to pick up certain superclass fields?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM