Tag Archives: stringbuilder

7,283 views

File open read to StringBuilder close Java example

BufferedReader , FileReader, StringBuilder , readLine, close Java example Android example String MYFILE = "my_file"; FileInputStream fis = openFileInput(MYFILE); int c; String sText = ""; while((c=fis.read())!=-1) {   sText += (char)c; // convert int to char } fis.close(); Java example … Continue reading

Posted in Android Examples Code | Tagged , , , , , | Comments Off on File open read to StringBuilder close Java example
10,463 views

Get text file content from raw folder to StringBuilder Android example

StringBuilder, res/raw folder, try catch finaly throws, BufferedReader, InputStream, openRawResource, getResources Android example MainActivity.java   public class MainActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; … Continue reading

Posted in Android Examples Code | Tagged , , , , , , | Comments Off on Get text file content from raw folder to StringBuilder Android example