I would like to know if it is possible to write an app that runs as a service (background) and simulates an input (keypress) in the current application, let´s say that it collects inputs from an external source (bluetooth joystick) and converts into local keypress.
If your device is rooted then you can use this library.
you then can use
B4X:
Dim rc As RootCmd
If rc.haveRoot Then
rc.execRootCmd("input tap 100 200") '
End If
'
'If you need also to simulate the "back" key:
'
simulate tap on "back" key
rc.execRootCmd("input keyevent KEYCODE_BACK")