۱۳۹۴/۰۹/۱۰, ۰۴:۰۳ ق.ظ
(آخرین تغییر در ارسال: ۱۳۹۴/۰۹/۱۰, ۰۴:۴۲ ق.ظ توسط fvddesigner.)
لطفا نحوه ی ذخیره یه آرایه اعشاری در فایل رو توضیح بدید. ممنونم. روش خوندن از فایل متنی و ریختن مقادیرش در آرایه اعشاری به چه شکله؟
کد پیاچپی:
File root = android.os.Environment.getExternalStorageDirectory();
File dir = new File(root.getAbsolutePath() + "/posAnar");
if (!dir.exists()) {
dir.mkdirs(); // build directory
File file = new File(dir, "position1.txt");//create file!
if (file.exists()) {
file.delete();
}
try {
FileOutputStream f = new FileOutputStream(file);
PrintWriter pw = new PrintWriter(f);
for (int c1 = 0; c1 <= k; c1++) {
pw.println(String.valueOf(x11[c1]));
pw.println(String.valueOf(y11[c1]));
}
pw.flush();
pw.close();
f.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}