B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim Pedometer As PhoneSensors
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Private Label1 As Label
Private Label3 As Label
Private Label2 As Label
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
Activity.LoadLayout("main")
If FirstTime Then
Pedometer.Initialize(19)
End If
End Sub
Sub Activity_Resume
If Pedometer.StartListening ("19") = False Then
Label1.Text = "Pedometer not supported!"
End If
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Pedometer.StopListening
End Sub
Sub Pedometer_SensorChanged (Values() As Float)
If Sender = 19 Then
Label1.Text = NumberFormat((0), 0, 3)
Else
Label1.Text = "Somethings wrong"
End If
End Sub
Is what I'm trying to do. Trying to get the steps taken from this sensor but it somehow doesn't trigger or i'm miscalling the sensor somewhere...