I'm in the process of developing an Android app for which I need to add a button on the native call screen of the android. Is it possible to add a new button to the existing android call screen or should I create a custom screen specific to my app?
Edit: I want to add a button in addition to send the message to the defualt set number.
should I create a custom screen specific to my app?
Creating your own dialer would be a better option.
This is because even though you can draw your view using the android.permission.SYSTEM_ALERT_WINDOW you will still need to:
get the number the user has just entered (not dialed).
different devices may have different dialers so your button may not be positioned in all devices.
you need a mechanism which monitors if the user has opened the dialer. This will drain the battery.
Edit: I want to add a button in addition to send the message to the
defualt set number.
You can also create a Home Screen Widget for the same. Why even open the dialer?
Related
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
i'm working on an sms management application, it works instead of native android sms manager but i want to show my app on home(main) -i mean 1st screen-programatically.My application now seems on 6th screen and diffullt to reach to write a message.How can i put my app on home(main) screen?
I think you just need to move the app starter to the desired place. Moving an app starter can be done with long click on the app starter icon and then move it to the right place.
If a new android application is installed it automatically places it to the end of the app list on your phone. You have to move it then manually...
I agree with Lorenz, you cannot force your application to specific place in application list.
But you can add a shortcut to Home Screen whenever you launch the application, so that application is always accessible from HOME.
Try this for adding shortcut.
i just want to know how can i detect if the user opens an app so an activity of mine launches as well.
For example, the user opens the sms app and right after a kind of lockscreen appears.
You can create a service which will run int the background and you can use this API to determine which activity is visible. That's how many app lock works.
As far as I understand the Android system, it is not possible unless you are making a custom firmware.
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.
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.