Use C and NDK to access sensors without using Java.
Prerequisites
Android NDK (API-19).
If you want to compile the program for a different android API level(other than API 19), replace libandroid.so with the one of the API level you want to compile for.
Getting started
Setup environment
Go to the terminal.
export $PATH to your NDK bin folder(I assumed you already installed NDK.
eg. type : export PATH=/root/NDK/android-ndk-r19/bin:$PATH