                  (let [listener (reify SensorEventListener
                                   (onAccuracyChanged [this sensor value] ())
                                   (onSensorChanged [this event]
-                                    (apply #'push-vector stack (seq (list (. event values))))))]
-                   (send-every id stack interval)
+                                    (apply #'replace-mean stack (seq (list (. event values))))))]
+                   (send-every "Data" interval)
                    (.. sensorManager
                        (registerListener listener
                                          (.getDefaultSensor sensorManager sensor-type)

        [:linear-layout {:orientation :vertical}
         [:linear-layout {}
          [:text-view {:text "address"}]
          [:edit-text {:text "192.168.0.4" :id ::address}]]
         [:linear-layout {}
          [:text-view {:text "port"}]
          [:edit-text {:text "1234" :id ::port}]]
         [:linear-layout {}
          [:text-view {:text "interval(ms)"}]
          [:edit-text {:text "200" :id ::interval}]]

                                         SensorManager/SENSOR_DELAY_GAME))
                   listener))]
    [(create "rotate" Sensor/TYPE_ROTATION_VECTOR rotate-stack)
     (create "acc" Sensor/TYPE_LINEAR_ACCELERATION acc-stack)
     ]))

(def sensorManager (atom nil))

