I have an android Intent sending to the server the Latitude and Longitude send as string like this
try {
Double X = loc.getLatitude();
z = Double.toString(X);
Double Y = loc.getLongitude();
z2 = Double.toString(Y);
outToServer.writeBytes(z);
outToServer.writeBytes(z2);
}
catch (IOException e1) {
e1.printStackTrace();
}
then the latitude and longitude send and save in the server databases than other intent what to fetch the database and get this string to be able to change it to double
String x=inFromServer.readLine();
String y=inFromServer.readLine();
x = x.trim();
Double p1 = Double.parseDouble( x);
y = y.trim();
Double p2 = Double.parseDouble( y);
But it force close Despite when I use the same command to convert the string s="12.23" nothing happened—no force close. How can I solve this problem, putting in consideration when Send the latitude and longitude as double they send as unknown symbols?
Logthe double value to see what it is. If it is a real double then it won't fail.