How do I read the file content from the Internal storage -Android APP -
How do I read the file content from the Internal storage -Android APP -
iam newbie- working android,
file created in location data/data/myapp/files/hello.txt
the content of file :"hello"
take how utilize storages in android http://developer.android.com/guide/topics/data/data-storage.html#filesinternal
to read info internal storage need app files folder , read content here
string yourfilepath = context.getfilesdir() + "/" + "hello.txt"; file yourfile = new file( yourfilepath ); also can utilize approach
fileinputstream fis = context.openfileinput("hello.txt", context.mode_private); inputstreamreader isr = new inputstreamreader(fis); bufferedreader bufferedreader = new bufferedreader(isr); stringbuilder sb = new stringbuilder(); string line; while ((line = bufferedreader.readline()) != null) { sb.append(line); } android internal
Comments
Post a Comment