Detect incoming outgoing or ringing calls while the app is closed or open
Why Stack Overflow recommends it
Stack Overflow users link it as a worked example when asking or answering how to react to phone call state changes with a BroadcastReceiver on Android.
Recommended by 2 people across 2 different months, 2018 to 2022.
What it is
A tutorial video from the channel born to code official that shows how to detect incoming, outgoing and ringing phone calls in an Android app using a BroadcastReceiver, working whether the app is open or closed. It accompanies a GitHub call recorder project with source code.
What people said
Recommends aforbes · 2022-05 · Stack Overflow · on “Android Studio - getting PreciseCallState of phone calls”
I'm trying to build an Android app in Android Studio to detect the precise call state of outgoing calls. I'm new to Java, and I'm going around in circles with a few problems. The basic calls states are working fine for me per this youtube guide [this video] . That tutorial uses "TelephonyManager.EXTRA_STATE" in its main class and the "android.intent.action.PHONE_STATE" receiver in the AndroidManifest. It successfully detects when an outgoing call is placed and ended, but NOT when it actually starts ringing/is answered/etc. I'm trying to get the PreciseCallState of outgoing calls using a couple of StackOverFlow guides like this one How to Use PreciseCallState [LINK] and other similar discussions,
Recommends Mostafa Harb · 2022-12 · Stack Overflow · on “Incoming call notification”
If you got the choice to change the notification service, instead or directly using firebase, you could use Onesignal which extends firebase and they already have a service named VOIP notifications which should kinda do your needs and here is the link: [LINK] In case your are restricted with firebase or need to know how this could be done, bellow will be the way to achieve it.. As for android: First as logic part, you need to add some code in the native layer since hybrid apps usually can't interact from JavaScript side to native side in case app was not launched, so in order to wake the application on a specific event like notification received or any other actions that phone system can hol
Cites user9548729 · 2018-06 · Stack Overflow · on “Unable to record voice calls audio from other end in android >5.1”
change this recorder.setAudioSource(MediaRecorder.AudioSource.MIC); to this recorder.setAudioSource(MediaRecorder.AudioSource.VOICE_COMMUNICATION); [this video]
Cites Balhut · 2020-09 · Stack Overflow · on “Showing ToastAndroid when app is closed with react-native and Headless JS”
I've been trying to integrate BroadcastReceiver with my react-native app. I want to show the ToastAndroid whenever someone calls me. It works great when the app is running (either in foreground and background) but when I kill the app it doesn't trigger ToastAndroid anymore. I've seen a video ( YT link [this video] ) of someone doing it in native code and it works even when the app is killed. How can I accomplish it with react-native? My Service code: public class CallService extends HeadlessJsTaskService { @Override protected @Nullable HeadlessJsTaskConfig getTaskConfig(Intent intent) { Bundle extras = intent.getExtras(); if (extras != null) { return new HeadlessJsTaskConfig( "Call", Arguments.fr