Is there a way to use default incoming call screen with its functionality (answer and reject) from inside my application.
I want to make fake call from inside my application and i don't want to create custom incoming screen but use default incoming call screen on device because different devices have different incoming screens.
No, this can't be done using the standard SDK. First, the call screen activity can only be launched by the system. Second, vendor-specific skins of Android often replace the default phone app with a custom one, so it's unlikely you'd be able to do this on all devices with just a single piece of code even if it were possible.
Your best bet would be to try to recreate the incoming call screen for the most popular devices and detect which device the user is running, which I know isn't what you wanted to hear. Sorry.
Related
I'm looking for a way to show the default "incoming call screen" to the user.
The user should be able to interact it (i.e. answer/deny) and my application should receive this chosen action.
Although I can design my own "incoming call screen" for sure (kind of faking the default one), but is there any way to ask Android (on a physical device) to display the default screen (I would populate the phone number / name to display).
I don't want to create this screen from scratch, as it won't be exact with the system default, and it would take quite some time for me.
(Motivation: I'm customizing an Android phone, it will show an incoming call screen when the call is actually coming into my other phone - two phones will negotiate the notification/actions via some common interface like Bluetooth or Wifi).
ps: rooting is available, so I have literally no limitation.
I'm trying to get an idea of what's possible and what isn't in terms of using a custom dialler app for internet calls.
The idea is that the standard Android dialler be used when no internet connection is available, but use a custom-written VOIP dialler / caller app whenever an internet connection is available.
I see that in the Android call settings you can set it to use Internet calling whenever a connection is available. How does this work? Does this simply tell the native dialler app to use internet calling, or is there actually a specific Intent or something that gets fired when an internet call is made so that I can open my custom SIP app?
And also, is the 'standard phone app' icon always linked to the standard phone app, or can you override this phone icon to open your custom VOIP app when a connection is present?
So basically, is there a way to seamlessly and automatically switch between the standard dialler and the custom SIP dialler based on whether or not the phone is connected to the internet?
If not, is this something that could be done by customizing Android?
Thanks,
There are four possible ways of doing what you want that I know of:
1. Replace the Android Dialer
This is hard and a lot of work. The Android Dialer (last time I checked anyway) WAS the telephony stack in Android. So to replace it you have to replace the complete telephony stack (including any public API) i.e. handle all cellular (and now sip) calls in and out of the device. Also the only way to replace it is to root the device as it can't be replaced normally.
2. Provide your own Dialer that is separate to the main dialer.
This has it's advantages that you will never get into "trouble" with anything else.
3. Hook into the outbound call API (ACTION_NEW_OUTGOING_CALL)
This is something that is pretty cool and I haven't seen any other OS allow you to do. Basically you can trap when either the normal dialer starts to dial a number (or when another application starts to dial a number as well) and you can either allow it through, modify it or cancel it. Behavior I've seen from sip clients is that they will cancel the call and put up a selection screen prompting where you want to send the call (sip, cellular or something else).
Here is an example of it's use.
The downsides are:
You can be fighting with other applications to which gets first go. There is a 'priority' setup, but all I've seen is everybody wants to be number one.
On some Android devices where the OEM providers that own Dialer, they don't always fire it!!!
4. Detect when the dialer is shown and show your own dialer in front of it.
This works and does allow you to provide a nicer more integrated feel as you can provide call type selection within the dialer, as well as other custom number lookups but that can be a little tricky to do on some devices.
I would suggest 3 to begin with as it's pretty easy to do and you can get something up going pretty fast. In code that I have worked on, we have done 2, 3 and 4 and also looked into 1.
Is it possible to detect incoming call before default phone application, and prevent to active default phone application in Android?
Looks like it may not exactly be possible according to this -> Create a custom call handling Application.
Anyway more research may be required on your side to check if it can be. Multiple posts on Phone broadcast receiver can be used as reference.
Can anyone help me how to create a fake call.
as same mobile I want to create a fake name or number and fix timing : Example
5sec.(here i am using the toggle button enable disable fake call)
You cannot create fake calls. You could pretend that it is a call by re-creating the look of dialing screen in your application and show it when you need to fake the call, but you cannot fool (perhaps it might be doable on rooted devices, but I assume you target regular devices) the system and make system dialer (or replacement) to think there's a call while there's not.
Is there a way to make a call from my application, but keep my activity in focus? ACTION_CALL shows the call screen, but I want to show my screen instead, with my own control to end the call. Is this possible? e.g. is there a service that does the actual phone call?
I basically want to allow the user to call another user, while still interacting with my app.
You can not change or customize the call screen unless you are building your own ROM
That is not possible from an SDK application...
You can try to design your application so that it works with a backgroud service so that you achieve your goals