I have a program out in beta testing. One of the testers get an error consistently. Since he is far away, I cannot do a debug on his unit (or can I? How?)
All I get is this: “An error has occurred in sub: main-gps-location changed (java line: 2395) java.Lang.number format exception”. I have looked at every line in that sub but cannot find where a number format exception can be.
Is there a way to relate the java line back to the B4A program line to help me get a better idea of where the problem lies?
Funny thing is, I run the debug on my phone and every line process fine - no errors.
Here is the code from the sub:
Any advice or help will be GREATLY appreciated
Johannes
All I get is this: “An error has occurred in sub: main-gps-location changed (java line: 2395) java.Lang.number format exception”. I have looked at every line in that sub but cannot find where a number format exception can be.
Is there a way to relate the java line back to the B4A program line to help me get a better idea of where the problem lies?
Funny thing is, I run the debug on my phone and every line process fine - no errors.
Here is the code from the sub:
B4X:
Sub GPS_LocationChanged (Location1 As Location)
Dim Lat As Double
Dim Lon As Double
Lat = Location1.Latitude
Lon = Location1.Longitude
Dim LatDegText,LonDegText As String
Dim LatDeg,LatMin,LonDeg,LonMin As String
Dim PentadLat,PentadLon As String
Dim PentadTempTxt As String
LatDegText = Location1.ConvertToSeconds(Location1.Latitude)
LonDegText = Location1.ConvertToSeconds(Location1.Longitude)
LatDeg = LatDegText.SubString2(1,3)
LonDeg = LonDegText.SubString2(0,2)
LatMin = LatDegText.SubString2(4,6)
LonMin = LonDegText.SubString2(3,5)
PentadLat = LatDeg & LatMin.SubString2(0,1)
If LatMin.SubString2(1,2) < 5 Then
PentadLat = PentadLat & "0"
Else
PentadLat = PentadLat & "5"
End If
PentadLon = LonDeg & LonMin.SubString2(0,1)
If LonMin.SubString2(1,2) < 5 Then
PentadLon = PentadLon & "0"
Else
PentadLon = PentadLon & "5"
End If
PentadTempTxt = PentadLat &"_"&PentadLon
CurrentPentad = PentadTempTxt
GpsLblLatDec.Text = NumberFormat2(Location1.Latitude,0,6,6,False)
GpsLblLatDms.Text = Location1.ConvertToSeconds(Location1.Latitude)
GpsLblLonDec.Text = NumberFormat2(Location1.Longitude,0,6,6,False)
GpsLblLonDms.Text = Location1.ConvertToSeconds(Location1.Longitude)
GpsLblAlt.Text = NumberFormat2(Location1.Altitude,0,0,0,False)
GpsLblAcc.Text = Location1.Accuracy
GpsLblPentad.Text = PentadTempTxt
' Dim GpsLblSat As Label
If InPentad = True Then
If CurrentPentad <> SelectedPentad Then
PlayDingDong = SP.Play(LoadDingDong,1,1,1,0,1.5)
Msgbox("YOU HAVE LEFT THE SELECTED PENTAD. STOP MAPPING TO KEEP ACCURATE TIMING","W A R N I N G")
InPentad = False
End If
Else 'Out of Pentad
If CurrentPentad = SelectedPentad Then
PlayDingDong = SP.Play(LoadDingDong,1,1,1,0,1.5)
Msgbox("YOU HAVE ENTERED THE SELECTED PENTAD. START MAPPING TO KEEP ACCURATE TIMING","W A R N I N G")
InPentad = True
End If
End If
End Sub
Any advice or help will be GREATLY appreciated
Johannes