Sidebar and Glovebox Apps become popular overnight because of only one functionality. They provide global menu which can be open from left or right edge of mobile screen. As developer when I show this apps,first thing that comes in my mind was "NDK". Then after I start looking for the solution. Logically I figure out that IF I can detect "Global onTouch Event" then It's posible to display side menu like sidebar or glovebox.
Problem 1: Detect Global Touch Event Problem 2 : Display Sliding Menu.
Solution For Problem 1:
- Create service to detect touch event.
- Fetch WindowManager object from system service
- Create LinearLayout having 30 px width and fill_parent height
- Add LinearLayout to WindowManager
- set LinearLayout on left edge of screen / window.
Why I need to Service ? Because we can't get event when activity goes in background or close.
What if I make LinearLayout width more then 30 px ? The control or activity which display in background will not get onTouch event.