android catch touches in background - android

I want to provide user with a way to control my application then it is in background. I implemented special hidden area in a corner via overlay. But such solution has lots of restrictions: only 2 possible actions for each hidden area (one for regular touch and other for long press), other applications use the same behavior (area can be overlapped) etc.
While searching for alternatives I found the AGS application here.This application uses gesture and it catches them everywhere on the screen.
AFAIK it is impossible to do with overlay, Am I right? Any ideas how to implement such behavior?

Related

Android: How to find out if keyboard/soft input is visible using a background service

It is possible to determine if the keyboard is visible from an activity but is it possible to determine from a background service? I'm developing a floating action button feature that's pinned to the bottom, however, when the keyboard comes up I want to re-position the floating action button.
Its actually not even possible to do from an Activity. There's some code that's widely distributed that tries to do it, but its based on a hack that may or may not work under all circumstances. I wouldn't rely on it. Particularly it has problems with split screen mode, alternative keyboards with very small heights, and when screen casting to different size monitors. Under all those circumstances it has a tendency to break. It may work some of the time, but its not reliable.

Can a mobile app blur the screen?

Is it possible a mobile app working like a background process to blur or fade the screen of the smartphone, no matter what active app is being displayed? Does the android and ios APIs expose such features?
Definitely not on Android. There are accessibility services which do modify the screen regardless of which app is visible but those are mostly first party applications. It would be a pretty big security risk issue if apps could block/blur the screen of other apps.
That being said you can create an overlay which lets touches through. I'm not sure if you can get the actual pixels of the UI behind the overlay and run a blur yourself but you can draw over top of elements on the screen (using accessibility APIs you can get the positions of UI elements) which may suit your needs depending on what exactly you're trying to achieve.

Altering the global/master UI from a background app in android

Is it possible for an android app to run in the background, listen to specific triggers and modify the visible application content in the screen (in both system and third party apps)?
For an example, A 2 finger tap should lead to a ripple effect on the screen. If the temperature is high, The screen turns more reddish. If I say "do a barrel roll", The entire UI does a "barrel-roll" like the google Easter egg. And this should happen whether the user is in the homescreen, settings or his Instagram.
The best working example I can give is the built-in "Magnification Gesture" provided by Android. Three taps anywhere will zoom everything up except for the keyboard and the navigation bar. And it doesn't zoom as an image, the touch points are preserved.
Is this possible to do without or with root? Do I need a framework like Xposed?
Thanks.

How to record touch movements on Android keyboard?

I apologize if this is a stupid question. I have only taken an introductory Java class and am a beginner to Android.
I want to track the drawing made by a finger using Swype and record each stroke as an image or vector of some sort.
Is there a simple way to record a touch movement in another application, maybe by making an application running in the background?
Thank you and I appreciate any guidance!
Touch events are consumed by the top-most view. Because swype doesn't have any kind of API you can hook into you won't be able to get that information. Input Events | Android Developers
There might be some way to create a skeleton keyboard application that captures the gestures that people make over an image of the swype keyboard that then passes that gesture to the real swype, but I'd personally be worried about copyright unless it was just for personal use.

What is gesture in Android

I would like to know what is meant by gestures in typical mobiles more specifically android ones. Android supports gesture recognition.
Is a gesture termed as when user
holds the device and shakes it(say
upwards, downwards or side- side)?
Is a gesture termed as when a
finger is placed on the screen and
traced UP,DOWN,RIGHT,LEFT? If so
what is the difference between touch
screen and gestures.
I am confused between 1) and 2) option.
What is a gesture exactly?
As I understand it, a gesture is anytime a user touches the screen and does a pre-defined motion that the system understands. I would venture to say that shaking the phone is not a gesture, but a function of detecting changes in the accelerometers.
From Android's reference web page, a gesture is a hand-drawn shape on a touch screen. It can have one or multiple strokes. Each stroke is a sequence of timed points. A user-defined gesture can be recognized by a GestureLibrary.
https://developer.android.com/reference/android/gesture/Gesture.html
I see gestures as being a type of input pattern that you expect from the user. I.e., you can setup mouse gestures in web browsers to do things like going "Forward" or "Back" in the browse by doing a specific "gesture" (maybe middle mouse button click and moving the mouse left goes "Back").
I'll give a brief answer to your bonus question: Yes, it's quite possible to to character recognition from input gestures on Android. In fact, at least one major vendor has already ported an existing handwriting engine to that platform. Works beautifully, but there's a lot of legal and marketing cruft to take care of as well before it ends up on real devices :(

Categories

Resources