1. Android Central Question's Avatar
    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"
    10-29-2018 06:09 AM
  2. B. Diddy's Avatar
    I moved this to the Software Development forum for more specific traffic.
    10-29-2018 06:20 AM
  3. Rukbat's Avatar
    The file is being written to "no folder", since you don't specify one. At best, it's /sdcard/co_ordinates.txt (or whatever the particular phone calls its internal sd card). Try specifying a folder, starting from /
    10-29-2018 01:45 PM

Similar Threads

  1. Went to the store to buy a Note 9, ended up with a Mate 20 Pro
    By Snappy Phoenix in forum Huawei Mate 20 & Huawei Mate 20 Pro
    Replies: 25
    Last Post: 11-03-2018, 02:45 AM
  2. Move apps to SD on huawei p8 lite 2017
    By Android Central Question in forum Huawei P8 lite
    Replies: 2
    Last Post: 10-29-2018, 01:59 PM
  3. LG K20 plus volume and camera won't work
    By JJWyatt72 in forum Ask a Question
    Replies: 1
    Last Post: 10-29-2018, 06:38 AM
  4. Replies: 1
    Last Post: 10-29-2018, 06:31 AM
  5. Move apps to SD on huawei p8 lite 2017
    By Android Central Question in forum Ask a Question
    Replies: 0
    Last Post: 10-29-2018, 05:24 AM
LINK TO POST COPIED TO CLIPBOARD