Back to project page intent_radio.
The source code is released under:
Copyright (c) 2014 Stephen Blott Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Soft...
If you think the Android project intent_radio listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.smblott.intentradio; //from www. ja v a 2 s .co m import android.content.Context; import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; public class ReadRawTextFile { /* ******************************************************************** * Read raw text file resource... * * source: http://stackoverflow.com/questions/4087674/android-read-text-raw-resource-file */ public static String read(Context context, int resId) { InputStream stream = context.getResources().openRawResource(resId); InputStreamReader reader = new InputStreamReader(stream); BufferedReader buff = new BufferedReader(reader); String line; StringBuilder text = new StringBuilder(); try { while ( ( line = buff.readLine()) != null ) text.append(line + "\n" ); } catch (Exception e) { return ""; } return text.toString(); } }