public class Assets {
public static String getAssetString(String asset, Context context) {
BufferedReader bufferedReader = null;
try {
bufferedReader = new BufferedReader(new InputStreamReader(context.getAssets().open(asset)));
String line = null;
StringBuilder builder = new StringBuilder();
while (null != (line = bufferedReader.readLine())) {
builder.append(line).append("\n");
}
return builder.toString();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}finally{
if (null != bufferedReader) {
try {
bufferedReader.close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
bufferedReader = null;
}
return "";
}
}
String result = Assets.getAssetString("level1.txt", this);
Log.i(TAG, result);
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 2, 2, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 2, 2, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
12-15 13:43:09.134: I/BuiltTestActivity(32468): 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,