Hello!I am developing a project and currently I am fetching data from sensors(TYPE_LINEAR_ACCELERATION, TYPE_GRAVITY, TYPE_MAGNETIC_FIELD, TYPE_GYROSCOPE, TYPE_ACCELEROMETER, TYPE_ORIENTATION, TYPE_ROTATION_VECTOR), hardware. As of now, I found out that the these sensors do not send events when the screen is off, so even when I grab a wakelock from within one of my programs, I can verify that my program is still running (through LOGcat output) but no sensors event comes out. I have to dim my screen on (which I cannot afford, the battery drains too fast) to start receiving sensors events again. So I was wondering if I could have direct access to the hardware, with native code, without having to register to a listener. Is this possible? If so, could you kindly give some further advice? I would appreciate very much any help! |
In order to fulfill the basic functions of our service, the user hereby agrees to allow Xiaomi to collect, process and use personal information which shall include but not be limited to written threads, pictures, comments, replies in the Mi Community, and relevant data types listed in Xiaomi's Private Policy. By selecting "Agree", you agree to Xiaomi's Private Policy and Content Policy .