Recent Changes - Search:

About

Tech

Experiments

System Dev't

edit SideBar

July082008

July 8, 2008 Meeting

Dummy Applet Code

import java.applet.Applet;
import java.applet.AppletContext;
import java.net.URL;

public class DetectionApplet extends Applet {
  public void init() { }

  public void detectDevices(String deviceCallback, String finishCallback) {
    try {
      AppletContext appletContext = getAppletContext();
      String format = "javascript:%s('%s','%s');";

      appletContext.showDocument(new URL(String.format(format, deviceCallback, "Cricket", "/dev/ttyS1")));
      appletContext.showDocument(new URL(String.format(format, deviceCallback, "Super Cricket", "/dev/ttyS2")));
      appletContext.showDocument(new URL(String.format(format, deviceCallback, "Sun SPOT", "/dev/ttyUSB1")));
      appletContext.showDocument(new URL("javascript:" + finishCallback + "();"));
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

Example

Login to the beta page (http://isense.cs.uml.edu/beta) and then browse an experiment. Click the "join this experiment" link at the bottom of that page and click Detect Sensors.

Edit - History - Print - Recent Changes - Search
Page last modified on July 08, 2008, at 01:20 PM