Sub Activity_Create(FirstTime As Boolean)
Dim myLat As Double = 1.234d
Dim myLon As Double = 5.678d
'Test with android location object
Dim J As JavaObject
J.InitializeContext
J.RunMethod("locationTest",Array(myLat,myLon))
Dim myLocation As Location
myLocation.Initialize
myLocation.Latitude=myLat
myLocation.Longitude=myLon
Dim myLatSeconds As String = myLocation.ConvertToSeconds(myLocation.Latitude)
Dim myLonSeconds As String = myLocation.ConvertToSeconds(myLocation.Longitude)
Log("BA conversion is: "&myLatSeconds&" "&myLonSeconds) 'throws 1:14:2,4 5:40:40,8
Dim myLocationNew As Location
myLocationNew.Initialize2(myLatSeconds,myLonSeconds) 'here it crashes
End Sub
#if JAVA
import android.location.Location;
public void locationTest(double mLat,double mLon){
Location targetLocation = new Location("");//provider name is unnecessary
targetLocation.setLatitude(mLat);
targetLocation.setLongitude(mLon);
String sLatsec = targetLocation.convert(targetLocation.getLatitude(),targetLocation.FORMAT_SECONDS);
String sLonsec = targetLocation.convert(targetLocation.getLongitude(),targetLocation.FORMAT_SECONDS);
BA.Log("Converted latitude is: " + sLatsec + " " + sLonsec); // <-- 1:14:2,4 5:40:40,8
}
#End If