Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid- UnknownHostException stumper
    primarykey
    data
    text
    <p>i have been trying to call a PHP script with the android system. i am using Eclipse helio and everything else i have written works fine on it - not much yet. so i block copied this code and it does not work: i have no warnings or errors and i can debug and step through it, but it always comes back with</p> <p>"E log_tag : Error in http connection java.net.UnknownHostException: www.X.com"</p> <p>here is the code:</p> <pre><code> List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;(2); nameValuePairs.add(new BasicNameValuePair("Lat","19.80")); nameValuePairs.add(new BasicNameValuePair("Lon","13.22")); HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.X.com/new/getAllPeopleBornAfter.php"); try{ httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); InputStream is = entity.getContent(); Log.i("postData", response.getStatusLine().toString()); } catch(Exception e) { Log.e("log_tag", "Error in http connection "+e.toString()); } </code></pre> <p>and the PHP which runs fine if i go there with a browser:</p> <p> <pre><code>mysql_connect("mysql27.x.com","name","PW"); mysql_select_db("dbname"); $q = mysql_query("SELECT * FROM people"); while ($e = mysql_fetch_assoc($q)) $output[] = $e; mysql_close(); echo (json_encode($output)); </code></pre> <p>?></p> <p>if you guys want me to run anything in a different format or any more info - please let me know - i cant find any thing more than just unknownhostexception</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload