Android examples for App:Assets
get Text From Assets
//package com.java2s; import java.io.IOException; import java.io.InputStream; import android.content.Context; public class Main { public static String getTextFromAssets(Context context, String filename) { String result = null;/*from w ww . j ava 2s.c om*/ try { InputStream in = context.getAssets().open(filename); byte[] bytes = new byte[in.available()]; in.read(bytes); result = new String(bytes); } catch (IOException e) { e.printStackTrace(); } return result; } }