BUG Community

Welcome! Log In

Forums BUG SDK javadoc?

Subscribe to javadoc?  6 posts, 3 voices

  • Voices:
  • dhensley
  • Bug Labs team kgilmer
  • koolatron

Log in to reply to this topic
Sep 25, 2007 6:14pm
Img_missing_medium dhensley 5 posts


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?



Sep 26, 2007 3:56am
Medium Bug Labs team kgilmer 215 posts

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:
    A) Defines abstract service definitions for that module.
    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:
    1. com.buglabs.common (common and base unit services)
    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.

Sep 26, 2007 5:13am
Medium Bug Labs team kgilmer 215 posts

Dave, I've uploaded javadoc for the Virtual BUG here:


I'll be working actively on making this better, but this should provide at least some initial help to you. :D

Sep 26, 2007 6:10am
Medium Bug Labs team kgilmer 215 posts

Dave, this app demonstrates how to listen to button events:


You can just drag the app from BUGnet into your project explorer.

Sep 26, 2007 9:37am
Img_missing_medium koolatron 52 posts


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?

Sep 26, 2007 12:51pm