|
![](/images/resource/spacer.gif) |
|
Android ช่วยดูโค๊ด มันขึ้น error java.net.socketexception: The operation timed out ครับ |
|
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
เขียน Code ให้ทำอะไรครับ ? ![](/images/bbcode/grin.gif?v=1001)
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2013-02-21 17:38:05 |
By :
mr.win |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
![](/images/resource/viewboard_01.gif?v=1001) |
|
|
![](/images/resource/viewboard_03.gif?v=1001) |
![](/images/resource/viewboard_04.gif?v=1001) |
|
code ส่งค่า พารามิเตอร์ ไป หา server ครับ
Code (Android-Java)
try{
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("empcode",empcode));
params.add(new BasicNameValuePair("sdate",date));
params.add(new BasicNameValuePair("edate",todate));
params.add(new BasicNameValuePair("abs_code",category));
params.add(new BasicNameValuePair("remark",note));
params.add(new BasicNameValuePair("action",action));
params.add(new BasicNameValuePair("username",username));
Log.d("params ask",params.toString());
// getting employee's details by making HTTP request
// Note that employee's details URL will use GET request
JSONObject json = jParser.makeHttpRequest(url, "GET" ,params);
Log.d("json ask",json.toString());
if( json != null){
// check your log for JSON response
int success = json.getInt(TAG_SUCCESS);
//Toast.makeText(getApplicationContext(), "บันทักเรียบร้อย" , Toast.LENGTH_SHORT).show();
Log.d("Single Employee's Details", json.toString());
if (success == 0) {
//successfully received product details
JSONArray reqObj = json.getJSONArray(TAG_ABSENT); // JSON Array
JSONObject reqDetail = reqObj.getJSONObject(0);
strMessage = reqDetail.getString(TAG_MESSAGE).toString();
Toast.makeText(getApplicationContext(), strMessage.toString() , Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(getApplicationContext(), "json is null" , Toast.LENGTH_SHORT).show();
}
}catch(Exception ex){
Toast.makeText(getApplicationContext(), "ex="+ex.getMessage().toString(), Toast.LENGTH_SHORT).show();
ex.printStackTrace();
}
|
![](/images/resource/blockviewtopic_01.gif?v=1001) |
![](/images/resource/blockviewtopic_02.gif?v=1001) |
![](/images/resource/blockviewtopic_03.gif?v=1001) |
![](/images/resource/blockviewtopic_04.gif?v=1001) |
Date :
2013-02-22 08:49:53 |
By :
rong |
|
![](/images/resource/blockviewtopic_06.gif?v=1001) |
![](/images/resource/blockviewtopic_07.gif?v=1001) |
![](/images/resource/blockviewtopic_08.gif?v=1001) |
![](/images/resource/blockviewtopic_09.gif?v=1001) |
|
|
![](/images/resource/viewboard_06.gif?v=1001) |
![](/images/resource/viewboard_07.gif?v=1001) |
|
![](/images/resource/viewboard_08.jpg?v=1001) |
![](/images/resource/viewboard_09.gif?v=1001) |
|
|
|
![](/images/digitalocean-banner.jpg)
|
Load balance : Server 03
|