InputStream in = null;
try {
in = urlConnection.getInputStream();
}
BufferedReader reader =new BufferedReader(new InputStreamReader(in));
Log.d("before endfdfdfdtering loop"," ");
StringBuilder str = new StringBuilder();
String line=null;
try {
str.append(reader.readLine());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
while((line=reader.readLine())!=null)
{
str.append(line);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
in.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String result=str.toString();
result=result.replaceAll(" ","");
Log.d("before entering loop"," "+result);
boolean flag;
if(result.equals("1"))
flag = true;
else
flag = false;
Above written is the code i have for getting data from local host but i cannot understand the code , Can someone please explain it and also tell me what to write on server side ( PHP language) to send data on android emulator . I have posted data to server from android emulator but do not know how to get data from server to Emulator.
i would want to send 2 strings from server to android emulator