Home › Android: calls in the foreground
Calls in the foreground (Android)
HearText is a calling app for deaf and hard-of-hearing people: making and receiving calls, with live captions of what the other person says. Users reply by typing (a digital voice speaks the text) or with their own voice.
Video
An incoming call with the call notification, answering, and the call in the app: the call status, the live captions and the digital voice speaking the opening sentence. Personal details (phone number, name and background photo) are blurred. The video has no sound.
FOREGROUND_SERVICE_PHONE_CALL
HearText handles phone calls (VoIP) through the Android Telecom API as a self-managed calling app (ConnectionService with MANAGE_OWN_CALLS).
- For an incoming call, the app shows a full-screen call screen, also on the lock screen.
- After answering, and during an outgoing call, the call runs as a foreground service with an ongoing call notification (with a hang-up button).
- This keeps the call connected and the live captions coming in, also when the user locks the screen or goes to another app.
- The task starts directly on a user action (answering or calling). It cannot be paused or resumed later: that would drop the call.
FOREGROUND_SERVICE_MICROPHONE
During a call, the user can talk with their own voice (“Talk” mode). The microphone sends this speech live to the other person and turns it into text for the conversation view.
- The microphone is only used during an active call that the user started or answered. It stops as soon as the call ends.
- If the screen is locked or another app is opened, the microphone must keep working; otherwise the other person no longer hears anything. That is why it runs in the foreground call service.
- Audio is not stored.
Camera
HearText does not use the camera and does not make video calls. The declaration FOREGROUND_SERVICE_CAMERA came from a video-calling component in a library we used (for the call screen). This component has been removed from the app.
Summary
HearText is a calling app for deaf and hard-of-hearing people with live captions of the other person's speech. It is a self-managed calling app (ConnectionService, MANAGE_OWN_CALLS).
- FOREGROUND_SERVICE_PHONE_CALL: an ongoing call (incoming, answered from a full-screen ringing screen, or outgoing) runs as a foreground service with an ongoing-call notification and hang-up action, so the call stays connected and captions keep arriving when the screen is locked or another app is opened. It starts on user action and cannot be paused or deferred without dropping the call.
- FOREGROUND_SERVICE_MICROPHONE: during a call the user can speak with their own voice ("Talk" mode). The microphone streams to the other party only during an active call and stops when the call ends; it must keep working when the screen is locked. Audio is not stored.
- Video: incoming call notification, answering, and the ongoing call with call status, live captions and the digital voice speaking the opening message. Personal details (phone number, name, wallpaper) are blurred; the video has no sound.
- Camera: not used. The camera service type came from a video-call option in a third-party ringing-screen library and has been removed.
