• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps override android device's sensors

foadrezek

Lurker
I need to build a networks protocol which transfers sensor messages between 2 devices, the receiving device can translate/map the sent sensor values to another sensor values ( i.e translate rotation of 20 right degrees to a touch click on pixel 55,123). Then the receiving device should stop listening to its' sensors instead, read the sent value and use them. The main goal is to play games using another device.

Now I am looking for a way to override the sensors of the device and inject another values, but don't have any idea in which layers should this change be made ? framework ? kernel ? application ?

Every small help is well appreciated !
 
At a guess Kernel but thats a dummys guess. Good luck with the project and keep us updated mate :)
 
Why the need to inject events? I mean it sounds like you can listen/stop listening as needed, sensors are just going to report what they are seeing.

I'd suggest re-thinking your logic to use the sensors as is.

That said, you can actually inject touch events but I dont know about sensors. I would imagine this can get get complicated quickly though.

all views have onTouchEvent

hth
 
Thanks for sharing your opinion guys.

@funkylogik :
I want to be sure that I must mess with kernel level and no change in a higher levels is possible for achieving the same purpose , and thanks for the sweet wishes.

@alostpacket :
The point is that I am not allowed to change any application I will demonstrate on, so I dont know how it is possible to disable its listening to the sensors. I need to inject the new sensors values, these values are not real HW values, as I said I take real values of other device, transfer them to the device to be controlled, map them into another sensor values, and I want to inject these mapped values somehow.
 
Back
Top Bottom