Android复习04(适配器 Get()请求 适配器 getView()方法 Post()请求 保存Cookie 流转字符串 从网上获取图片 重点考Json解析)
生活随笔
收集整理的這篇文章主要介紹了
Android复习04(适配器 Get()请求 适配器 getView()方法 Post()请求 保存Cookie 流转字符串 从网上获取图片 重点考Json解析)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
目? ?錄
適配器
Get()請求
適配器 getView()方法
Post()請求
保存Cookie
流轉(zhuǎn)字符串
從網(wǎng)上獲取圖片
重點(diǎn)考Json解析
適配器
?
Get()請求
適配器 getView()方法
Post()請求
保存Cookie
流轉(zhuǎn)字符串
/*** 將流轉(zhuǎn)為字符串* @param inStream 輸入流* @return 返回字符串* @throws IOException*/private static String is2String(InputStream inStream) throws IOException {ByteArrayOutputStream outStream = new ByteArrayOutputStream();byte[] buffer = new byte[1024];int len = 0;while((len = inStream.read(buffer)) != -1){outStream.write(buffer,0,len);}inStream.close();return new String(outStream.toByteArray(), "UTF-8");}private static String is2String2(InputStream inStream) throws IOException {BufferedReader br=new BufferedReader(new InputStreamReader(inStream,"utf-8"));StringBuffer sb=new StringBuffer();String line;while ((line=br.readLine())!=null){sb.append(line);}br.close();inStream.close();return sb.toString();}從網(wǎng)上獲取圖片
重點(diǎn)考Json解析
總結(jié)
以上是生活随笔為你收集整理的Android复习04(适配器 Get()请求 适配器 getView()方法 Post()请求 保存Cookie 流转字符串 从网上获取图片 重点考Json解析)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android复习01(内部存储、外部存
- 下一篇: android sina oauth2.