How to handle ALT+TAB key from Bluetooth Keyboard in Android Activity? - android

I want to capture ALT+TAB keys pressed from Bluetooth Keyboard connected to Device, and i want to do some custom action in my application.
As by default this Key Combination shows Recent Tasks.(May be in PhoneWindowManager.java::ShowOrHideRecentAppsDialog).
So i want to disable this action and want to handle this in my App. May be with help of onKeyShortCut() Function or so.
Can someone help me with some sample piece of code ?
FYI: If require , can make changes in Platform also.
Thanks a lot

Related

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

Android: Getting notified when a screen capture is done

Is there any way to get notified when a screen capture is performed using the soft key or the device hard key on android? Any way that works 2.3 onwards will help greatly.
Use case:
I already block screen capture using FLAG_SECURE. I want to show a Custom Dialog to the user when this action is performed. Android supplied mechanisms vary. Sometimes a notification is seen while at others, a blank screenshot is captured with no user feedback.
Is there any way to get notified when a screen capture is performed using the soft key or the device hard key on android?
No, sorry.

Missing dedicated search button on devices

My app used to trigger a local search window when ever user tapped on dedicated search button on the device. Lately, all the devices that come out in the market stopped providing that button.
I know I can provide a search option in the app, but this question is not about that.
Is there a way user can still emulate the triggering of search on the app by some key press combinations?
Any suggestion will be helpful.
Thanks,
SKU
Pressing and holding the menu button usually brings up the search function on new android phones (e.g. SGS1 or SGS2)

simulate a click action in a phone call in Android

I am a new and developing an android application to solve the following problem.
Sometimes I want to get some information through a call, here is the process.
call the number and I will hear the hint voice
press 1 to select the language
I wonder if there are library that can be used to simulate a click action during a call, so I can just type in the phone number and then the app will automatically select the language for me.
View.performClick() does exist, but the real problem is that you cant interact with that activity (as far as I know).
may be following link would help you:
http://www.androidpolice.com/2010/05/10/how-to-add-hard-wait-and-soft-2-3-sec-pauses-to-your-android-contacts/

Android user presses a key

Is there a way to register a receiver for a app running in the background for when a user presses a key. Kind of like "ACTION_USER_PRESENT" but if any keys were pressed on the screen.
MORE DETAIL: My app is running as a service in the background. User opens the phone and presses keys, like they searching for something online on their driod. Can I capture those key presses in the background?
To detect whether a user is using the device you could also use the information whether the screen is on or off as an approximation (making the assumption that the screen timeout is set). This blog entry shows how to capture the screen on and off events (I haven't done it myself though).
In the Android HCI Extractor ( http://code.google.com/p/android-hci-extractor/ ) we traverse the GUI and install some event filters (by using listeners) in the app top view.
Maybe if you can reach a top level view from which listen the events you could listen to all the events for this view. Let's try ;-)
This tool is an open-source prototype you can find here: http://code.google.com/p/android-hci-extractor/
It is very easy to integrate and use. In the tutorials you can see that only a few lines of code are needed: http://www.catedrasaes.org/trac/wiki/MIM
I hope it helps you!!

Categories

Resources