I'm trying to hack hardware key support into an existing app, but came to realize I know too little of Android app development to continue.
I can decompile and recompile the app without problems using APKtool, and I made a small app myself with hardware key support to pull the compiled smali code out of. For reference, that part looks like this:
.method public onKeyDown(ILandroid/view/KeyEvent;)Z
If I want to have the app listen for hardware keys "globally" (i.e. in every activity, window, what-have-you, of the app), where ought I put the onKeyDown code? Do I put it in a single activity (if so, which one), in all activities, or someplace else altogether?
Edit: I realize "globally" is a bit ambiguous here. I mean throughout the entire app, not system-wide.