Java tutorial
//package com.java2s; import android.content.Context; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { /** * @param context * @param resId * @return */ public static List<String> geFileToListFromRaw(Context context, int resId) { if (context == null) { return null; } List<String> fileContent = new ArrayList<String>(); BufferedReader reader = null; try { InputStreamReader in = new InputStreamReader(context.getResources().openRawResource(resId)); reader = new BufferedReader(in); String line = null; while ((line = reader.readLine()) != null) { fileContent.add(line); } reader.close(); return fileContent; } catch (IOException e) { e.printStackTrace(); return null; } } }