1
ändern habe ich diesen Code:Wie kann ich die XML-Datei einer Immobilie (Android Studio)
private Properties properties;
private static final String myFile = "properties.xml";
// code for properties
File file = new File(getFilesDir(), myFile);
properties = new Properties();
try{
if(file.exists()){
FileInputStream fish = openFileInput(myFile);
properties.loadFromXML(fis);
fis.close();
Toast.makeText(this, "LOADED FROM STORAGE", Toast.LENGTH_SHORT).show();
} else {
FileOutputStream fosa = openFileOutput(myFile, Context.MODE_PRIVATE);
properties.storeToXML(fos, null);
fos.close();
Toast.makeText(this, "CREATED THE FILE", Toast.LENGTH_SHORT).show();
}
}catch(Exception e){
Log.wtf("MAIN", "error loading file");
}
Und ich möchte die XML-Datei eingeben, die die Eigenschaft erzeugen, aber es doen't in die erscheinen Android-Studio-Projekt, weiß jemand, wo kann ich es finden, oder wie es durch Code ändern? Hier
Es ist in [internen Speicher] (https://commonsware.com/blog/2014/04/07/storage-situation-internal-storage .html) des Geräts oder Emulators, auf dem Sie Ihren Code ausgeführt haben. – CommonsWare