Hello, I have looked through the various examples I could find beeing these:
https://www.b4x.com/android/forum/threads/orientation-and-accelerometer.6647/#content
The original thread if you will, and for a bit it seemed like this would provide all the sensory goodies. But ill be honest with you, for someone new, its a bit daunting. I'm unsure what int or strings I need to call to get them into my own variables.
https://www.b4x.com/android/forum/threads/phonesensorsextra-library.43175/#content
Is way too advanced i'm not even sure where to put them nvm using them with out an example.
https://www.b4x.com/android/forum/threads/android-shake-event-with-phonesensors.9857/#content
Also did not really help me...
https://www.b4x.com/android/forum/threads/kitkat-step-detector.40563/#content
Okay so I do that... but still no clue where to get the step taken or steps taken from? I'm probably too dumb but the code seems way more advanced...
This is very helpful! This is clear and easy on the eyes. But I still struggle how to get the steps taken and step taken events.
I'm sure the example from Erel is great but i'm having trouble getting data out of it. And i'm sure its me but if someone could explain this to me id be very grateful.
https://www.b4x.com/android/forum/threads/orientation-and-accelerometer.6647/#content
The original thread if you will, and for a bit it seemed like this would provide all the sensory goodies. But ill be honest with you, for someone new, its a bit daunting. I'm unsure what int or strings I need to call to get them into my own variables.
https://www.b4x.com/android/forum/threads/phonesensorsextra-library.43175/#content
Is way too advanced i'm not even sure where to put them nvm using them with out an example.
https://www.b4x.com/android/forum/threads/android-shake-event-with-phonesensors.9857/#content
Also did not really help me...
https://www.b4x.com/android/forum/threads/kitkat-step-detector.40563/#content
Okay so I do that... but still no clue where to get the step taken or steps taken from? I'm probably too dumb but the code seems way more advanced...
B4X:
Sub Process_Globals
Dim ps As PhoneSensors
End Sub
Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
ps.Initialize(ps.TYPE_ACCELEROMETER)
End If
End Sub
Sub Activity_Resume
If ps.StartListening("Sensor") = False Then
Log("Sensor is not supported.")
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
ps.StopListening
End Sub
Sub Sensor_SensorChanged (Values() As Float)
Values(2) < -8 Then 'Check Z value
Log("Device face down")
Else
Log("Device face up")
End If
End Sub
This is very helpful! This is clear and easy on the eyes. But I still struggle how to get the steps taken and step taken events.
I'm sure the example from Erel is great but i'm having trouble getting data out of it. And i'm sure its me but if someone could explain this to me id be very grateful.