I am working on android. when a calls comes in, I want to replace the default android call screen with a new screen that has answer and deny call options. How can I do that? Need some help. Any help appreciated.
Do I have to use a toast message for this?
I do have the incoming and outgoing classes.
As far as my understanding goes it is not possible to replace the call screen with an App that is installed over the Marketplace.
To do this you would at least require root permissions. Maybe you also need to reconfigure the Android Version installed on the phone.
Related
How to send Android device to sleep or programmatically press the power button(KEYCODE_POWER) with Kotlin?
Is it possible?
Some example?
Thank you advance!
In Android (regardless of whether you use Kotlin, Java, whatever) for
security reasons it is not possible for an app to make the device
sleep, unless your app is a system app provided by the phone
manufacturer.
discuss.kotlinlang.org
Maybe you still can. Rather old post here https://forum.xda-developers.com/showthread.php?t=1210421 says to use gotosleep function. There are discussions of problems with it for Java - see below links, but maybe for Kotlin it will work.
Attempting to put Android device to sleep, but the PowerManager does not contain a "goToSleep(long) method
Android system application DEVICE_POWER permission error
Android What permissions required to call PowerManager.goToSleep(n) put device in sleep mode?
I am building an Android app and want to initiate an anonymous phone call for both caller and receiver.
For example:
User A press 'call User B' button, and then initiate an anonymous phone call to User B. The tricky point is that both User A and B don't know each other's phone number and after the conversation, there is no record left and privacy is protected.
I don't know if native Android can do this. Could anyone give me some clues about this? Thank you very much!
According to the platform source-code there is NO WAY to place a call without the knowledge of the user. The best thing you can do is to make the call automatically but the user will see a dialog saying: "Calling XXXXXXXX" and he will have the chance to cancel it.
Even if you make your own dialer application you will have to sign it with the system key and place it in the system/apps folder in order to get the required permissions for that kind of things.
As for the call log, I don't know if you can make the call not to appear in it in the first place but I think (not sure though) that you can find it and deleted afterwards. Android informs other applications of call actions via Intents so it is relative easy to detect when a call ended and then query the call log.
Hope this helps...
I'm developing an android app that blocks incoming phone calls while running.
but after a block sequence android's main keys(Back,Home,..) just changes to a dotted circle !
can any one please tell me what is this
and help me to get main buttons back?
by the way - i'm testing on : Sony C2305(Android 4.2.2)
This is what happens when your android phone is ringing(in default). since you changed default functionality of androids caller mechanism so its what really happen:
1- your phone rings and default caller turns on and hides android system keys in order to display caller screen
2- your application launches too and rejects call using code(and not androids caller application)
3- so as call rejected so androids default application closed with no response(without getting KEYs back!)
Thats it.
so i guess you should work with main caller istead of your own code to solve this problem.
Hope help you
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.
In android programming, is it possible to make a phone call within a service without showing the 'phone call screen'? Any example would be very helpful. Thanks in advance.
In android programming, is it possible to make a phone call within a service without showing the 'phone call screen'?
That depends on what you consider the "phone call screen" to be.
If you mean the dialer, then, yes, you can use an ACTION_CALL Intent to bypass that, assuming that you hold the CALL_PHONE permission.
If you mean the in-call screen then, no, AFAIK there is no way to avoid that screen. That screen is rather important for the user.