I have used Erel's code for accelerometer http://www.b4x.com/android/forum/threads/orientation-and-accelerometer.6647/
to display x,y,z values. Now i want to add another value say t, that i can append to the x,y,z values and hence it will become x,y,z,t. The value t is the time of recording accelerometer values (datetime and nanoseconds). In java i can get the same t value this way
I want to display the same in basic4android format. I also want to save this values (i.e. x,y,z,t) in a text file as comma delimited (e.g. -1.2233,0.9766,1.8990,20140514191005xvfcccc where xvfcccc is nanoseconds).
Please help me with sample code that can do the above.
to display x,y,z values. Now i want to add another value say t, that i can append to the x,y,z values and hence it will become x,y,z,t. The value t is the time of recording accelerometer values (datetime and nanoseconds). In java i can get the same t value this way
B4X:
long MiliTime = System.currentTimeMillis();
long NanoTime = sensorEvent.timestamp;
// Time now = new Time();
// now.setToNow();
Time t = new Time(Time.getCurrentTimezone());
t.setToNow();
String date = t.format("%Y/%m/%d %H:%M:%S");
timevalue=String.valueOf(date)+NanoTime
Please help me with sample code that can do the above.