David Findlay

BugLabs: Second App "BUGer"

Over the weekend, the BugLabs folks posted a request to have the testers try and all work on the same task:

Hi, Now that you've had some time playing around in a fairly open context, we'd like to try a structured project where everyone is working on the same task, and see how the results play out.

The first project is to use the BUGbase and the motion detector module to build a home security system. This is a pretty straightforward project (in our estimation) and shouldn't take too long if you're already up to speed on the platform. For those of you new to the environment, it should be a good way to learn the basics of BUG.

Here's the "specifications" of the home security system: On any detected motion, the system should log an alert with the current date/time stamp. The alert log should be accessible via a Web interface.

Yup, it's that basic. For a little extra help, here are the basic steps to build the system: 1. Create a new BUG application, in the creation wizard select the IMotionSubject service.
2. Register a listener for callbacks to when motion is detected. Create and append to a file and log the date and time of occurence.
3. Create a menu item for the application that allows for the logging to be turned on and off.
4. Create a servlet that retrieves the log data from the log file and presents it to a web client.
5. Confirm that your application works by triggering motion events from the command line.

Once you are done, upload the app to BUGnet. If you need any help with the project, please let us know.

We also have a few ideas for those of you who want to push your app "to 11" (although you can be as creative as you want!), here are some of ours: * When an event happens, send an SMS * Send an email report at the end of every day * Double gold star project: also integrate with the camera, and make a picture available with each event. * something else???

Thanks, we'd love to see this wrapped up in a week if possible!
Best,
Jeremy
_________________
I'm the Bug Labs "marketing guy"


I had a bit of spare time on Sunday night so I put together "BUGer" that does pretty much what Jeremy was asking for. I added in the camera stuff too, so BUGer takes a picture on each motion event. However the servlet container in the VirtualBUG doesn't yet support static resources, so the image can't be displayed on the webpage. It's there for when it can though. If I find time I may look at putting in the email part, but the PhoneME JME doesn't have email stuff in it that I could see, and scraping SMTP seems tedious, so I may not. I'm also not sure how you would do SMS unless you did it as email-to-your-cell-phone, which is just email from the BUG's perspective, since the SMS part is done by the carrier's email server.