I am working on a client app. He want to give android cellphones to his employees. With our app already installed. In our app he wanted to get the record of every phone call.
I know how to do it, I made the BoradcastReceiver. But it is only working in the older version. New Version like Android Nougat and Pie has restriction on it. And I do not any working solution of catching call event.
So Here is what I am doing in my app that is working on older version.
<receiver android:name=".MyCallReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.PHONE_STATE"></action>
</intent-filter>
</receiver>
public class MyCallReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context,"Call Event",Toast.LENGTH_LONG).show();
}
}
Solution I found:
So on older version I am watching this toast. but same code not working on the new versions. I Have read that we need to declare same broadcast in code.
So on above R&D I have some confusion
Confusion: When declaring in code, will it work even my app is not running at all?
Another Question:
Also we want to track the other calls? is it possible like call of whatsapp and viber?
Please give me detail answer of what to do in case 1 and is it even possible to track calls of whatsapp and viber andother apps like this?