Although there is some example code available for creating an Android accessibility service there isn't a full example that brings together all the different bits.
This repo should provides a very basic example service that can be built upon.
The only thing you should need to do is create a local.properties
file with the sdk.dir
parameter set:
sdk.dir=/path/to/sdk