|
|
Hi, I have been all over the site today and last night, so I apologize if I have overlooked things, but I was wondering if there is a javadoc page and a developers guide for interacting with the unit and modules. For example. I would like to find out how to: 1) handle input from the hotkeys. (can I register a callback?) 2) get notified when the motion sensor senses a change (what data does it send me)? Is there a current document(s) that covers this, or am I left with downloading the bug source code from SVN? Thanks, Dave |
|
|
Hello Dave! Good questions :) Sadly Javadocs were not baked into our initial SDK beta release. That has since been rectified but won't be available until our next build. Depending on timing I may publish javadocs to our beta site. In regards to your specific questions: 1. You sure can register a callback. The service definition for this is com.buglabs.device.IButtonEventProvider (which lives in the com.buglabs.common OSGi bundle). In the case of the Virtual BUG, com.buglabs.bug.emulator implements the service. I will provide an example application on BUGnet tomorrow on how to capture hot key events. 2. Yep! In general each hardware module has a corresponding OSGi bundle that:
B) Provides base implementations So for your specific case the service definition you want is com.buglabs.bug.module.motion.pub.IMotionSubject provided by the com.buglabs.bug.emulator.module.motion bundle. Our convention is that each OSGi bundle is a project in SVN. Most of the interesting service definitions for BUG live in one of the following bundles:
2. com.buglabs.bug.emulator.module.camera (camera module services) 3. com.buglabs.bug.emulator.module.gps (...) 4. com.buglabs.bug.emulator.module.lcd 5. com.buglabs.bug.emulator.module.motion Another convention (from the OSGi folks) is to put service definitions (interfaces) in a public package, and implementations in private packages. So generally you'll see the service definitions in com.buglabs.bug.module.[module name].pub packages. Again, an application will be provided on BUGnet that exercises this service. In general your best bet is going to be looking for example apps, which we are actively producing and adding to BUGnet. I'll post back to this thread with upcoming documentation details. Thanks! ken |
|
|
Dave, I've uploaded javadoc for the Virtual BUG here: http://bugbeta.com/specifications/javadoc/ I'll be working actively on making this better, but this should provide at least some initial help to you. :D thanks! ken |
|
|
Dave, this app demonstrates how to listen to button events: http://buglabs.net/application/show/4 You can just drag the app from BUGnet into your project explorer. |
|
|
Ken, Thanks a ton! I went through the trouble of checking out the SVN trunk last night just to get a peek at the sources while I was playing around with MenuExtender, but having javadoc (even incomplete javadoc) all in one spot sure makes things easier. Any idea whether the next sdk build will break existing projects? |
|
|
Going forward SDK releases should not cause applications to break. From time to time we may change some service interfaces, but hopefully that will usually be additive. But in general any release that breaks existing APIs and interfaces will be documented in the SDK release notes. |