api - How can i track the android phone operations internally? -


i want develop mobile app stores user operations clicking, selecting, swiping, , closing apps database. have store button name, id , time of operation.

how can track in android without disturbing other apps running?

there no native way of doing this, because exposing (easy) api allow way many people track users' actions, including passwords type on (virtual) keyboard, poses real security issue. assuming app develop has tracking main purpose (and not background "additional" non-advertised tracking), less of concern.

it possible capture some events without interfering other activities using overlay. in service, create capture window, specify type_system_overlay flag_watch_outside_touch:

mview = new touchcaptureview(this); windowmanager.layoutparams params = new windowmanager.layoutparams(             windowmanager.layoutparams.type_system_overlay,             windowmanager.layoutparams.flag_not_touch_modal |             windowmanager.layoutparams.flag_watch_outside_touch,             pixelformat.translucent); windowmanager wm = (windowmanager) getsystemservice(window_service); wm.addview(mview, params); 

then override touch capture view's ontouchevent record every motionevent in database. however, not allow know user clicked on, button, checkbox, etc, , there no way of knowing (plus controls may custom implementation). determining resulting action plain impossible do, apps doesn't broadcast users' actions other apps. also, beginning android 4.0, overlay windows don't capture events anymore, type_system_alert still interferes other activities.

tl;dr: can't .


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -