Android Read Text file in SD Card (Java Android) ตัวอย่างการเขียน Android เพื่ออ่านข้อความที่อยู่ใน Text file(Read text file) โดยในตัวอย่างนี้มีทั้งอ่านข้อความที่มีบรรทัดเดียว และกรณีที่มีหลายบรรทัดจะแสดงข้อความใน ListView
รูปแบบการอ่านข้อความที่อยู่ในไฟล์
1.String path = "/mnt/sdcard/mydata/thaicreate.txt";2.File file = new File(path);3.BufferedReader br = new BufferedReader(new FileReader(file));4.ArrayList<String> myArr = new ArrayList<String>();5.String line;6.while ((line = br.readLine()) != null) {7.myArr.add(line);8.}