Search code examples
androidlayoutservicetransparentgesture

Make a service to recognize gesture to bind an event on top of all other applications Android 4.X


I try to do a service that will recognize the movement (+ longclick move up) to associate an event. However, I need this service also works when another application is launched.

At the moment I create a service that gives me a transparent LinearLayout. I can well recover movement, BUT I can not use the current application below. Can not click through the layout. I wish, however, that this is possible and that my service detects this movement only.

EX: on Android kitkatt there now has a fullscreen mode and during a slide back down on windowing with the appearance of the taskbar, and the application below have not impacted.

Have you any ideas ?

Thanks.


Solution

  • I wish, however, that this is possible and that my service detects this movement only.

    That is not possible from an SDK app on Android 4.0+. Either you receive the touch events or the underlying app receives the touch events, not both. Otherwise, this would represent a security flaw known as tapjacking.