Search code examples
androidiosphone-call

Is it possible to programmatically make a call on background?


I know it's probably impossible for security reasons but I am asking anyway because I can't find an answer on google. Is it possible to create an app (Android/iPhone) that starts an automatic call when the phone OS is locked?

possible scenario:

  1. user opens the app.
  2. the app executes a command in background that after 1 minute should start the call.
  3. user locks the phone.

Will the app execute the phone call?


Solution

  • Yes it's possible for Android I think. You can use the AlarmManager or an Handler for the schedule problem. To decide which you have to take. Here an exceprt from the Android documentation:

    Note: The Alarm Manager is intended for cases where you want to have your application code run at a specific time, even if your application is not currently running. For normal timing operations (ticks, timeouts, etc) it is easier and much more efficient to use Handler.

    For starting a call in Android you can take a look here.