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:
Will the app execute the phone call?
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.