x


How do I find a folder I can write data to on Android?

I need to store savefiles for my game on Android, but I can't figure out what path to write to. Application.dataPath returns the path to my apk folder, but I can't write anything there. Is there some relative path I can use ../ from Application.dataPath to get to? The files should stay permanently with the app, so a cache folder would be inappropriate.

more ▼

asked Nov 13 '10 at 01:48 AM

Russ Menapace gravatar image

Russ Menapace
46 3 3 3

(comments are locked)
10|3000 characters needed characters left

3 answers: sort oldest

There is an example plugin that shows how retrieve the cache directory. It can easily be modified to return the persistent files directory instead (replace getCacheDir() with getFilesDir()). But as far as the script API goes there is currently (with 3.1) no support for that.

more ▼

answered Nov 25 '10 at 08:51 AM

eriQue gravatar image

eriQue
196 3

(comments are locked)
10|3000 characters needed characters left

Just Use PlayerPrefs. This will this will handle everything automatically. This makes saving games really simple.

more ▼

answered Mar 17 '11 at 02:37 PM

Richard 3 gravatar image

Richard 3
424 46 50 61

(comments are locked)
10|3000 characters needed characters left
more ▼

answered Nov 25 '11 at 03:44 PM

arsalank2 gravatar image

arsalank2
76 3 3 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2489
x242
x72
x19

asked: Nov 13 '10 at 01:48 AM

Seen: 2877 times

Last Updated: Nov 25 '11 at 03:44 PM