public void startNotify() {
    release();
    if (enableLights) display.flashBacklight(1000);

    if (lenVibra > 0) display.vibrate(lenVibra);
    new Thread(this).start();
  }
示例#2
0
  private void showCamera() {
    try {
      mPlayer = Manager.createPlayer("capture://video");
      mPlayer.realize();

      mVideoControl = (VideoControl) mPlayer.getControl("VideoControl");

      Canvas canvas = new CameraCanvas(this, mVideoControl);
      canvas.addCommand(mBackCommand);
      canvas.addCommand(mCaptureCommand);
      canvas.setCommandListener(this);
      mDisplay.setCurrent(canvas);

      /*
      Form form = new Form("Camera form");
      Item item = (Item)mVideoControl.initDisplayMode(
          GUIControl.USE_GUI_PRIMITIVE, null);
      form.append(item);
      form.addCommand(mBackCommand);
      form.addCommand(mCaptureCommand);
      form.setCommandListener(this);
      mDisplay.setCurrent(form);
      */

      mPlayer.start();
    } catch (IOException ioe) {
      handleException(ioe);
    } catch (MediaException me) {
      handleException(me);
    }
  }
示例#3
0
 public void startApp() {
   textBox = new TextBox("Ophone", "\n", 512, TextField.UNEDITABLE);
   OxportMIDlet.addtext("Listo para exportar servicios...");
   textBox.addCommand(exitCom);
   textBox.addCommand(playCom);
   textBox.addCommand(initCom);
   textBox.setCommandListener(this);
   display.setCurrent(textBox);
 }
示例#4
0
 public void commandAction(Command c, Displayable s) {
   if (c.getCommandType() == Command.EXIT) {
     destroyApp(true);
     notifyDestroyed();
   } else if (c == mCameraCommand) showCamera();
   else if (c == mBackCommand) mDisplay.setCurrent(mMainForm);
   else if (c == mCaptureCommand) {
     capture();
   }
 }
示例#5
0
  public void commandAction(Command c, Displayable s) {
    if (c == exitCom) {
      destroyApp(true);
      notifyDestroyed();

    } else if (c == initCom) {
      if (ox == null) {
        textBox.insert("Exportando...\n", textBox.size());
        ox = new Oxport();
        ox.start();
      }
    } else if (c == playCom) {
      if ((ox == null) || (ox.getOServer() == null)) addtext("Playground need a OServer running");
      else {
        if (playground == null) playground = new PlayGround(this);
        display.setCurrent(playground);
      }
    } else {
    }
  }
示例#6
0
  public void capture() {
    try {
      // Get the image.
      byte[] raw = mVideoControl.getSnapshot(null);
      Image image = Image.createImage(raw, 0, raw.length);

      Image thumb = ImageUtility.createThumbnail(image);

      // Place it in the main form.
      if (mMainForm.size() > 0 && mMainForm.get(0) instanceof StringItem) mMainForm.delete(0);
      mMainForm.append(thumb);

      // Flip back to the main form.
      mDisplay.setCurrent(mMainForm);

      // Shut down the player.
      mPlayer.close();
      mPlayer = null;
      mVideoControl = null;
    } catch (MediaException me) {
      handleException(me);
    }
  }
示例#7
0
  public void startApp() {
    mDisplay = Display.getDisplay(this);

    mDisplay.setCurrent(mMainForm);
  }
示例#8
0
 public void exitPlay() {
   display.setCurrent(textBox);
 }
示例#9
0
 public OxportMIDlet() {
   display = Display.getDisplay(this);
   exitCom = new Command("Exit", Command.EXIT, 2);
   initCom = new Command("Export", Command.SCREEN, 1);
   playCom = new Command("PlayGround", Command.SCREEN, 1);
 }