title: android Parse String into double
body: <p>I have an android Intent sending to the server the Latitude and Longitude send as string like this </p>
  
  <pre><code>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();
  }
  </code></pre>
  
  <p>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 </p>
  
  <pre><code>String x=inFromServer.readLine();
  String y=inFromServer.readLine();
  
  x = x.trim();
  Double p1 = Double.parseDouble( x);
  y = y.trim();
  Double p2 = Double.parseDouble( y);
  </code></pre>
  
  <p>But it force close Despite when I use the same command to convert the string s="12.23" nothing happened&mdash;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?</p>