Android examples for App:Assets File
Load Asset JSON File
//package com.java2s; import java.io.IOException; import java.io.InputStream; import android.content.Context; public class Main { public static String AssetJSONFile(Context context, String filename) { String json = null;/* w w w. ja v a2 s .c o m*/ try { InputStream is = context.getAssets().open(filename); int size = is.available(); byte[] buffer = new byte[size]; is.read(buffer); is.close(); json = new String(buffer, "UTF-8"); } catch (IOException ex) { ex.printStackTrace(); return null; } return json; } }