I am currently building a game in Unity intending for android devices. Right now for development purposes I am coding by the keyboard controls. What would be the simplest and effective way of approaching the actions when the screen is swiped? I want to access the events screen is swiped left right back or front.
Easiest way to plug into the drag (and other) events is by using EventTrigger component on a UI element (for example Image)
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.
SO i am building a game in which i want to be able to allow the user to do certain actions based on the gesture on the screen.
For example, the user makes a circle with their finger on the screen and then something will happen.
Or the user makes a triangle and then something happens..
Is there any way to detect this type of gestures?
This guy wrote an awesome post on the topic with source included:
http://www.androiddevblog.net/android/gesture-detection-in-android-part-2-of-2
I have a live wallpaper which responds to touch and swipe/move events.
If I press the applications button on my phone, I get a menu with all my installed apps. My problem is that when I scroll through my list of installed applications, it triggers the touch and move events on my - out of sight - wallpaper beneath. The wallpaper is still hogging resources drawing and updating anyway, and while scrolling through my installed apps, it can become slightly sluggish.
I was wondering if there was a way to determine if either: the menu is open, or preferably - whether or not the livewallpaper is actually visible or not.
EDIT - I can only think to listen for ACTION_MOVE events in WallpaperEngine. If you detect one without onOffsetChanged being called then you can assume the menu is open and disable touch events.
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 :(