Back to project page datacollection.
The source code is released under:
MIT License
If you think the Android project datacollection listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package edu.fordham.cis.wisdm.actipebble; // w w w . j a va 2 s .co m import android.util.Log; import java.io.ObjectOutputStream; import java.io.Serializable; /** * This class acts as a bin for acceleration records and allows for easy serialization of the data * @author Andrew H. Johnston * @version 1,0STABLE */ public class AccelerationRecord implements Serializable { /** * The acceleration in the x-axis * @serial */ private float x; /** * The acceleration in the y-axis * @serial */ private float y; /** * The acceleration in the z-axis * @serial */ private float z; /** * The timestamp of when the record was taken * @serial */ private long timestamp; private static final long serialVersionUID = 2345673456543874764L; public AccelerationRecord(float _x, float _y, float _z, long _time) { x = _x; y = _y; z = _z; timestamp = _time; } /** * Used for serialization of the class * @param outputStream the output stream to write to */ private void writeObject(ObjectOutputStream outputStream) { try { outputStream.defaultWriteObject(); } catch (Exception e) { Log.wtf("AccelerationRecord", e.getMessage()); } } public long getTimestamp() { return timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; } public float getX() { return x; } public void setX(float x) { this.x = x; } public float getY() { return y; } public void setY(float y) { this.y = y; } public float getZ() { return z; } public void setZ(float z) { this.z = z; } }