Here you can find the source of getFromAssets(Context con, String fileName)
public static String getFromAssets(Context con, String fileName)
//package com.java2s; import android.content.*; import java.io.*; import org.apache.http.util.*; public class Main { public static String getFromAssets(Context con, String fileName) { String result = ""; try {/* w w w . j a v a2 s . c o m*/ InputStream in = con.getResources().getAssets().open(fileName); int lenght = in.available(); byte[] buffer = new byte[lenght]; in.read(buffer); result = EncodingUtils.getString(buffer, "UTF-8"); } catch (Exception e) { e.printStackTrace(); } return result; } }