Code example for ScheduledExecutorService

Methods: submit

0
        SensorAdapter height = new SensorAdapter();
        SensorAdapter lat = new SensorAdapter();
        SensorAdapter lon = new SensorAdapter();
        gps = new GpsSignal(locationManager, height, lat, lon,
                new DummyListener(), interval);
        futures.add(scheduler.submit(gps));
        signalMap.put(GPS_HEIGHT, height);
        signalMap.put(GPS_LAT, lat);
        signalMap.put(GPS_LON, lon);
    } 
     
    protected void createOrientationSignals(int interval) {
        logger.info("creating orientation signal");
         
        SensorAdapter yaw = new SensorAdapter();
        SensorAdapter pitch = new SensorAdapter();
        SensorAdapter roll = new SensorAdapter();
        orientation = new OrientationSignal(sensorManager, yaw, roll, pitch);
        signalMap.put(ORIENTATION_YAW, yaw);
        signalMap.put(ORIENTATION_ROLL, roll);
        signalMap.put(ORIENTATION_PITCH, pitch);