Android examples for File Input Output:Json String
get String Json Object From Asset
//package com.java2s; import android.content.Context; import android.content.res.AssetManager; import java.io.IOException; import java.io.InputStream; public class Main { public static String getStringJsonObjectFromAsset(Context context, String file) {/*from w w w . j a va2s .c om*/ String filePath = String.format("json/%s.json", file); AssetManager assetManager = context.getAssets(); try { InputStream is = assetManager.open(filePath); int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); return new String(buffer, "UTF-8"); } catch (IOException ex) { ex.printStackTrace(); return null; } } }