Is it possible to create an Android application that automatically attend incoming calls to an Android phone? If so, which APIs may be used to achieve this (a piece of code snippet highly appreciable)?
If the programmatic auto attendant feature not possible, why the Android OS imposes this restriction?
Is iOS behaves as same as Android in this scenario, please explain.
While googling I found something that can be useful. I haven't tried yet still I think this will help have a look at Call Control in Android
You can listen incomming call intent by implementing broadcast receiver Intent.CALL_STATE_CHANGED to listen for incoming call, but answering incomming call automatically seems not feasible.coz android application dont have access to incomming call audio stream.
Related
Is there is api where i can record all the incoming and outgoing call in android pie version . It seems nearly impossible to record a call. Please suggest what can be done in this scenario
Android disabled the api with their security update policy. Looking at the permissions list the closest you can find is the MANAGE_OWN_CALLS, meaning that the best solution for you is to implement a standalone application for calling where you should be able to interact with microphone directly.
Once ACTION_NEW_OUTGOING_CALL has been broadcasted, I need to capture the following event of the other party answer. Could you advice on how to achieve that please? I know it is possible as the Android dialer app changes the green Android icon to the person's photo exactly when they pick up.
UPDATED: I've had a look at the source of the app on Android handling the outgoing calls. I noticed the following method in ContactsUtils:
/**
* Kick off an intent to initiate a call.
*/
public static void initiateCall(Context context, CharSequence
phoneNumber) {
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", phoneNumber.toString(), null));
context.startActivity(intent); }
I guess my answer is in the activity listening for Intent.ACTION_CALL_PRIVILEGED. So to rephrase my question: Does anyone know which activity handles Intent.ACTION_CALL_PRIVILEGED?
I don't think there's such API and also there's no API for sending DTMFs due to the same reason that you can't tell when the call is being connected.
It does not necessarily needs to be possible to capture this as an outside app. The green android icon is a part of the application that controls the call, so it does not need a broadcast to change the icon.
As far as android's telephony manager is concerned u cannot detect programmatically whether the call has been answered or not. This is to say that u do not have the option to know when the user picked the phone at other end.
Android has got 3 states of telephony manager and none of them are capable of detecting whether the call was actually answerd or not(IN CASE OF OUTGOING CALLS)
The only way you may be able to do this is by parsing the Logcat logs, no PhoneStateListener event is available for that.
Some are asking for it here: https://code.google.com/p/android/issues/detail?id=14266
Anyway, in versions above Android 4.2 as Logcat is "sandboxed" it may be impossible...
I am developing an application in android for device usage profiling and analysis where I have to read features from the android OS.
For example i have to read
outgoing_calls
outgoings_calls_to_non_contacts (un-saved numbers)
outgoing_sms
outgoings_sms_to_non_contacts (un-saved numbers)
Keyboard_related readings (pressure, key_dwell_time, key_flight_time etc)
delete_key_use_rate
average_transition_left_right
average_transition_right_left
touch_screen_pressure
What will be the way to accomplish this? i.e what libraries from SDK do I have to use.
Any example for reading these values will be very helpful.
Kind Regards
Khurram
Your Application should have Broadcast Receivers. And Register Various Intents.
For Ex : Outgoing Call : android.intent.action.NEW_OUTGOING_CALL and android.intent.action.PHONE_STATE.
For Outgoing Messages : Detecting SMS incoming and outgoing
For Keyboard related I am not sure , How to do that :)
Because of security/privacy issues not all of these values are available for standard android programs. The only way I know to achieve this, is to root the device and attach yourself to the system services you need. If you only want to analyse the usage of your own application you have to write a subclass for each class which is a direct or indirect subclass of View and overwrite the onTouchEvent, onKeyPressed, onClick... events and extends these classes in your application.
I'm devlopping a SIP application and whant to launch the normal incoming call interface when having an incoming call from a SIP client. Is that possible ?
Thank you very much.
I am sorry, but it looks like there is nothing as standard incoming call interface in Android (at least not until API level 10).
The screen that you see on incoming call is part of the native PhoneApp. More specifically, it is handled by the class InCallScreen.java from the dialer source code. That Activity has no Intent filters defined, so definitely it is not intended for external usage.
However, some applications may mimic native screens (or copy complete layout, not sure if license allows that), so it looks like it is from native, although in fact it is not.
I checked the source of default phone app, and I figured the only way to get this done is draw a layout exactly like the default incoming call interface -_-||
If you have the solution , please tell me , thank you so much !
Once ACTION_NEW_OUTGOING_CALL has been broadcasted, I need to capture the following event of the other party answer. Could you advice on how to achieve that please? I know it is possible as the Android dialer app changes the green Android icon to the person's photo exactly when they pick up.
UPDATED: I've had a look at the source of the app on Android handling the outgoing calls. I noticed the following method in ContactsUtils:
/**
* Kick off an intent to initiate a call.
*/
public static void initiateCall(Context context, CharSequence
phoneNumber) {
Intent intent = new Intent(Intent.ACTION_CALL_PRIVILEGED,
Uri.fromParts("tel", phoneNumber.toString(), null));
context.startActivity(intent); }
I guess my answer is in the activity listening for Intent.ACTION_CALL_PRIVILEGED. So to rephrase my question: Does anyone know which activity handles Intent.ACTION_CALL_PRIVILEGED?
I don't think there's such API and also there's no API for sending DTMFs due to the same reason that you can't tell when the call is being connected.
It does not necessarily needs to be possible to capture this as an outside app. The green android icon is a part of the application that controls the call, so it does not need a broadcast to change the icon.
As far as android's telephony manager is concerned u cannot detect programmatically whether the call has been answered or not. This is to say that u do not have the option to know when the user picked the phone at other end.
Android has got 3 states of telephony manager and none of them are capable of detecting whether the call was actually answerd or not(IN CASE OF OUTGOING CALLS)
The only way you may be able to do this is by parsing the Logcat logs, no PhoneStateListener event is available for that.
Some are asking for it here: https://code.google.com/p/android/issues/detail?id=14266
Anyway, in versions above Android 4.2 as Logcat is "sandboxed" it may be impossible...