A
Android Central Question
I am trying to store data into a text file. Code snippet is as below -
String FILE_NAME = "co_ordinates.txt";
try {
FileOutputStream fos = Resource.getAppContext().openFileOutput(FILE_NAME, Context.MODE_PRIVATE);
for(int i=0; i< mDB.size(); i++) {
Pose2D pose =mDB.get(i);
Float X = pose.getX();
fos.write(X.toString().getBytes() );
}
fos.close();
} catch (Exception e) {
ToastUtil.showToast(Resource.getAppContext(),"File Write Error!");
e.printStackTrace();
Code is executing but I cant find the file anywhere. When I try to see it under my package in device file Explorer it says "run-as: Package 'com.example.myPackage' has corrupt installation"
String FILE_NAME = "co_ordinates.txt";
try {
FileOutputStream fos = Resource.getAppContext().openFileOutput(FILE_NAME, Context.MODE_PRIVATE);
for(int i=0; i< mDB.size(); i++) {
Pose2D pose =mDB.get(i);
Float X = pose.getX();
fos.write(X.toString().getBytes() );
}
fos.close();
} catch (Exception e) {
ToastUtil.showToast(Resource.getAppContext(),"File Write Error!");
e.printStackTrace();
Code is executing but I cant find the file anywhere. When I try to see it under my package in device file Explorer it says "run-as: Package 'com.example.myPackage' has corrupt installation"