It is very simple to put Code directly.
Package COM. example. demogame; import Java. io. file; import Java. io. fileinputstream; import android. app. activity; import android. OS. bundle; import android. view. view; import android. widget. button; import android. widget. edittext; import android. widget. toast; public class mainactivity extends activity {button but; // open the button reference @ overridepublic void oncreate (bundle savedinstancestate) {super. oncreate (savedinstancestate); setcontentview (R. layout. activity_main); but = (button) findviewbyid (R. id. button01);. setonclicklistener (new view. onclicklistener () {public void onclick (view v) {string contentresult = loadcontentfromsdcard ("androidsummary.txt"); // call the file reading method to obtain the edittext etcontent = (edittext) findviewbyid (R. id. edittext01); // instantiate edittextetcontent. settext (contentresult) ;}});} Public String loadcontentfromsdcard (string filename) {// read the content from the SD card string content = NULL; // The SD card content string try {file F = new file ("/sdcard/" + filename); // the file to be read int length = (INT) F. length (); byte [] buff = new byte [length]; fileinputstream FD = new fileinputstream (f); FD. read (buff); // bytes from the input stream. length data is read into a byte array. close (); // close this input stream and release all system resources associated with this stream content = new string (buff, "UTF-8");} catch (exception e) {toast. maketext (this, "Sorry, no file found", toast. length_short ). show () ;}return content ;}}