1

Where would I save text files that the user would be able to easily access later on Android?

I'm using Adobe AIR, which is an important note, and it has some predefined File paths:

var fileLocation:String = "my_file.txt";
file = File.applicationStorageDirectory.resolvePath(fileLocation);
file = File.applicationDirectory.resolvePath(fileLocation);
file = File.desktopDirectory.resolvePath(fileLocation);
file = File.documentsDirectory.resolvePath(fileLocation);
file = File.userDirectory.resolvePath(fileLocation);
file = new File(fileLocation);

Note: There is a related question here [1] but it uses an Android specific API. It's fine if that's the best location but what that translates into for AIR is what I'm looking for (as in which is an equivalent location in the code above).

Let's say that one of those paths points to the appropriate or acceptable location. Would you place that file in a sub directory?

[1] Android - Where to save text files to?

4

1 に答える 1

1

File.userDirectory と File.documentsDirectory はどちらも SD カードのルート ディレクトリに保存されます。これがおそらく最適な出発点です。ユーザーが見つけやすいように、アプリケーションと同じ名前の別のディレクトリを追加することをお勧めします。

于 2012-11-08T07:16:35.217 に答える