Actually, words you used here have meaning which differs from your requirement. What I think you need to implement set of libraries.
For that you first need to understand the working of Linux OS, and then how android utilize it for its purpose.
Here i'll try to make some brief description for your requirement.
Linux Kernel have two layers - User space and kernel space, user space is responsible for interaction with users and kernel is responsible for interacting with hardware. And how both interact with each other is by procedure called System Call.
Core concept is also same here. Top three layers as shown are the part of user space. Bottom layer is kernel layer.
See attached
here also mode of communication between user space and kernel space is system call. But usually only layers of library plays the role to make communication between the above layers and the kernel.
You also have to do the same, you can add a new library, in which using system calls interface you can talk to kernel.
Also In order to access the methods of the shared library from java code, you need to bring in JNI wrappers
around the methods exposed from your shared lib.
That's all, as per your requirement you can also develop your library.
Then you need to push that file into /system/lib
using adb push
command. Their can be a case push may not work, then try to mount /system
adb shell mount -o remount,rw /system //and then again try to push
adb push mylibrary.so /system/lib/mylibrary.so
adb shell chmod 644 /system/lib/mylibrary.so // set the permission
If sometime, you still can't able to push that file, try to root that device.
After you'll reboot the device that library will work.
Regards