摘要: 单元测试1: 2:public String read(String filename)在自己的类中写被测试的方法,如:fileservice类的service方法3:建立测试类public class Test extends AndroidTestCase {private static final String TAG="Test";public void testRead() throws Throwable{FileService service=new FileService(this.getContext());String result=service.re 阅读全文
posted @ 2013-07-31 17:25 Blue-Dream 阅读(258) 评论(0) 推荐(0)
摘要: HttpClient进行网络通信----------------------------------1:get方式String httpUrl = "http://59.64.158.106:8080/test/xxx.jsp"; //HttpGet对象 HttpGet httpGet = new HttpGet(httpUrl); try{ //取得HttpClient对象 HttpClient httpClient = new DefaultHttpClient(); //请求HttpClient,取得HttpResponse HttpResponse httpResp 阅读全文
posted @ 2013-07-31 17:22 Blue-Dream 阅读(227) 评论(0) 推荐(0)