与Android的API,我可以模拟/创建来电?

问题描述:

使用Android的API的,我可以模拟/创建来电?这不是用于测试目的。其实我是想我的应用程序调用手机本身,并把它响。

With Android APIs, can I simulate/create an incoming call? This is not for testing purposes. I actually want my app to call the phone itself and have it ring.

为了创建一个模拟来电,您将需要播放与此相关的意图。如何处理来电的一些信息,可以发现的此处。实际上,您将需要在自己创建广播意图,并通过在必要的临时演员。创建具有额外意图的一个例子,以及如何处理它们在你的应用程序,可以发现的这里

In order to create a "mock" incoming call, you would need to broadcast the intent associated with this. Some info on how to handle an incoming call can be found here. You will instead need to create the broadcast intent on your own, and pass in the necessary extras. An example of creating an intent with extras, and how to handle them in your app, can be found here.