Read/write to external XML file in Android

后端 未结 3 1823
栀梦
栀梦 2020-12-08 12:01

I\'m trying to learn more about reading/writing to an XML-file (as a kind of database) in Android. I can\'t seem to find anything about this so I guess I don\'t know what te

3条回答
  •  抹茶落季
    2020-12-08 12:41

    To create new file in /storage/sdcard0/your_app_name/ use following:

    File file = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + "your_app_name" + "/" + xmlFile);
            file.createNewFile();
            FileOutputStream fileos = new FileOutputStream(file);
    

提交回复
热议问题