After almost a year the IMWatch developer site has finally released a library to access the sensors. They even released an example application but no documentation ???
Fortunately there are some tools to decompile java apps.
Below are the prototypes for the two undocumented functions the you’ll need to use to get access to the sensors.
public SensorServiceInstance(int updateInterval) public SimpleShakeDetector(Context context, OnShakeListener listener, int updateInterval)
The important argument here is the updateInterval. It’s an int but what does it represent. A few tests show it’s the number of milliseconds between samples. Reading the decompiled code implies that this value must be greater than zero but has no other limits.
The application I’m writing needs to have a 200Hz update rate so I tried setting this value to 5 ms. This doesn’t get the required update rate. It seems the practical lower limit to updateInterval is 100ms which doesn’t even match the game update interval for the Android standard sensors updates. 10 Hz isn’t even the lowest rate I can use for my application.
Digging deeper into the sources looks like they have included a native i2c library to access the sensors. I might be able to use that to get direct access and increase the update rate. Stay posted for a blog post on where I get with that.
The full decompile source is available here.
Once again IMWatch has underwhelmed with no documentation and a marginally functional sensor library. Another release, another fail.
You’ve trying to solve same problem I’m working on. 🙂
Thanks for the useful info!