Blog

1 search results for:

1

android使用json与php服务器端通信

/ in Blog / by Vinge.dai
因为项目需求,目前开发的android应用需要使用json与php服务端进行通信,通过get,post方式与服务器端进行数据交互,基本实现方式记录如下: Get方式: protected String getRequest(String url, DefaultHttpClient client) throws Exception { DefaultHttpClient client = new DefaultHttpClient(new BasicHttpParams()); //超时请求 client.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 5000); //读取超时 client.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 5000); String result = null; int statusCode =…

Need Translation Service?

Please enter your personal details and we will contact you shortly.