Friday, 15 June 2012

latitude longitude - How to store the LatLng variable in Android in an SQL Lite Database for use later? -



latitude longitude - How to store the LatLng variable in Android in an SQL Lite Database for use later? -

i trying store marker info in sql lite database on android device, converting latlng variable string , saving way.

latlng latlng coords = latlng.tostring();

the problem is, , have tried many things, converting string latlng variable can used again. looking latlng variable see 2 doubles separated comma, thinking splitting string , converting doubles passing latlng don't know how in android.

any ideas on how this?

i solved doing this:

latlng latlng; double l1=latlng.latitude; double l2=latlng.longitude; string coordl1 = l1.tostring(); string coordl2 = l2.tostring(); l1 = double.parsedouble(coordl1); l2 = double.parsedouble(coordl2); googlemap.addmarker(new markeroptions() .position(new latlng(l1, l2)) .title(title) .snippet(info));

so latlng variable 2 doubles, strings,back doubles , passed newmarker position , works!

:)

android latitude-longitude

No comments:

Post a Comment