The API is called JSR256. Googling for "JSR256 example" will give you what you need, for example this one: http://developer.sonymobile.com/downloads/code-example-module/utilize-the-w910-accelerometer-in-j2me-using-jsr-256-the-bouncing-ball-game/
JSR256 specification: http://jcp.org/en/jsr/detail?id=256