Android: Is it possible to add functionality to the call screen? - android

Is it possible to customize the call screen in Android? Example would be, two users have the same application, user calls, but the other user cannot pick up, so they respond with some type of predetermined image baked into the application.
Is this possible?
Does this break any rules?

The built-in Phone application is open source, so you can clone it and modify it to your own needs. This will let you make/receive calls using your custom UI (I believe you can receive. It looks like there's ACTION_ANSWER that you can listen to and handle). Of course, the user will be prompted on what application to use for theses actions and you'll have to convince your users that they should use your app instead of the built-in one.

Related

scroll android programmatically in all applications

I created a background service on android and I have two buttons which appear on the top of the screen all the time. I want to use these two buttons like scroll down and scroll up. But these two buttons should work on any kind of applications like Instagram, Facebook, Twitter and so. So, it means it should work in all applications that use scrolling.
I search a week on internet but I could not find any solutions.
This is not possible, sorry. Something like this would require your Service to have access to the Views of the applications and this would be a huge security breach, because you could read values from them and so on.
You could achieve this with a custom button code broadcast (so basically your buttons would act as physical buttons on the device) but this would most probably require you to have system-level permissions and some level of cooperation with the OEMs.
Android Activity class has a method called dispatchKeyEvent(), which could let you simulate the key input (with some limitations) but this is not present in the Service class.
Sadly this is not something you can do in Android. Typically you should not be able to touch views with a background service, the point of a background service is that you do some work in it (for example upload files to your web server or get some data). You CAN send a signal from a service once you're finished doing work to tell an app that something needs to happen, however the app needs to be specifically coded to respond to this broadcasted event.
If you wanted to do this with an app that you have developed, that can be achieved by using the onReceive method of say a BroadcastReceiver, however you cannot specifically define the behaviour of other apps as this would represent a security breach in Android.

Android . Activating my application when some string was entered in some other application

I am trying to create a behavior where entering some string in any application will open my application.
I've tried looking around on how to listen for keyboard press or listening for text change, but I couldn't find my required behavior and I don't want to create a custom keyboard for this.
If this is not possible, what will be a good implementation for lunching my application as fast as possible while in the other application?
Answered before the requirement to "don't want custom keyboard"
The only viable way that I can think of is if the user was using a custom keyboard written by you. Custom keyboards can and do act as key-loggers and therefor could detect any key combination, or written word and allow you to execute your code when your conditions are met.
Rerfer to Creating an input method docs
How to open my app as fast as possible from another application?
Press home, launch your app by clicking on the launcher icon
But assuming you mean without doing that, you'll still need to monitor some event, say volume keys pressed or device being shaken for instance, or have you app be running already in the foreground such as what Facebook messenger does (or used to do, I don't know)
Related questions:
What APIs in Android is Facebook using to create Chat Heads?
Listen to volume buttons in background service?
How to detect shake event with android?
Demo of bubbles

Can I setup IVR on my Android phone?

I think to make it possible I need to make the app automatically respond to the incoming calls. Is that possible at all?
I want to build an android application for small business. Using this application a business owner can:
setup a custom IVR menu
Auto forward calls to another number depending upon at what time the call has been made and what option has the user chosen in the IVR menu
Automatically dial-in (merge call) another number in the call
Is it possible to do all this?

Custom dialler for Internet Calls (Android)

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.

Opening/Displaying the default dialer in app (actually using the dialer not passing data to it)?

I've looked at a few posts here like this but this doesn't seem to do what I intend (unless I'm just doing it wrong.) The other posts I see are either about replacing the dialer with a custom dialer or passing an input to the dialer.
I don't want to replace the dialer and I don't want to pass the data where the user inputs a number and then sends it to the dialer.
I would just like to bring in the default dialer inside the app. Example:
1) The user opens the app, they see their default dialer but with a different heading (just so they know they're inside my app). They enter the number, press call it calls the number.
2) If the user presses their call button outside of the app, they just do the normal dialer without my app. So the user never uses my app in (2).
I think that's pretty clear but if not just let me know. Since I can't seem to find any tutorials or posts about doing this online, it leads me to wonder if this is against a policy? Or perhaps a concern the users will be confused as to what they're doing? I think with a different heading they can know if they are using my app or not.
I would just like to bring in the default dialer inside the app
Sorry, but that is not possible.
it leads me to wonder if this is against a policy?
If by "against policy" you mean "not possible from a technical standpoint", then yes, it is against policy. You cannot embed the UI from another process in yours, by and large. This is not unique to the dialer, or to your app.

Categories

Resources