Hi I'm trying to send some parameters to my php server
I really want my php server to receive what user sended parameter and store them at mysql database
If I try to connect http://somesite/store.php?Location=somewhere&temp=something using chrome browser It worked well.
But If I try to use it on android.
No record is updated in my database
what is my problem?
URL testUrl;
try {
testUrl = new URL("http://somesite.com/gcm_server/getdata.php?Location=bathroom&Humidity=25%&Temperature=27&Brightness=45");
HttpURLConnection conn = (HttpURLConnection)testUrl.openConnection();
InputStream in = conn.getInputStream();
InputStreamReader isw = new InputStreamReader(in);
int data = isw.read();
while (data != -1) {
char current = (char) data;
data = isw.read();
System.out.print(current);
}
Log.d(TAG, "testUrl= " + testUrl.toString());
conn.disconnect();
}catch(MalformedURLException ex){
Log.e(TAG, ex.toString());
}
catch(IOException e){
Log.e(TAG, "url connection Error");
}
If I try to connect then I got Log url connection Error but If I tried to connect somesite (I covered it with different site). I can connect using chrome browser
I don't know what is happening... Please hep me