/** * 获取json文件字符串 * @param fileName * @param context * @return */public static String getJson(String fileName, Context context) {    StringBuilder stringBuilder = new StringBuilder();    try {        File file = new File(fileName);        FileInputStream is = new FileInputStream(file);        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(is));        String line;        while ((line = bufferedReader.readLine()) != null) {            stringBuilder.append(line);        }    } catch (IOException e) {        e.printStackTrace();    }    return stringBuilder.toString();}

 

更多相关文章

  1. android 获取手机系统信息
  2. android 手机获取当前连接的wifi配置信息
  3. android cmd aapt
  4. 设置android默认属性
  5. Android调用系统下载服务下载文件
  6. AS gradle
  7. 如何在Android中在fragment中实现点击按钮事件?
  8. NPM 和webpack 的基础使用
  9. 【阿里云镜像】使用阿里巴巴DNS镜像源——DNS配置教程

随机推荐

  1. 【CSON原创】HTML5实现3D迷宫
  2. 在href元素中使用标记<c:out [duplicate]
  3. Tomcat中对Context应用
  4. css职位:相对;坚持到底
  5. 在一些页面中使用P和L定向生成PDF文档。
  6. 安装的Moodle字体在其他浏览器中不起作用
  7. TextView显示html样式的文字
  8. 在HTML / PHP联系表单上出现404/405错误(
  9. 急死我了!我以前用DREAMWEAVER编写的HTML
  10. HTML,CSS - 长表的行中断需要修复