Extensions creating

Hi everyone,
I had the idea of making an extension which lets allows for you to get the user activity such as sitting, running, driving, etc.
But I do not have any idea on how to implement this in android studios or even make an extension.
So this is where I was wondering if anyone is interested in helping me?

Code example:

Best Regards

You need to have knowledge of java for creating extension for AI