Hello,
First of all I will suggest to use a separator or a JSON structure to transmit this information. This way on client you do not have any problems separating the latitude & Longitude values. Now converting a string to numeric form can easily be achieved using
double lat = DOuble.parseDouble("latitude_value_string")
I am putting a pseudo code below.
public void onLocationChanged(Location location) {
latitude = location.getLatitude();
longitude = location.getLongitude();
coordinates = ("" + latitude + "," + longitude);
Transmit(coordinates);
}
On the receiving your code will look like something below, assuming that you have retrieved the string in
strData
.
string[] coOrds = strData.split(ne Char[] {','});
double latitude = Double.parseDouble(coOrds[0]);
double longitude = Double.parseDouble(coOrds[1]);
}
Regards,