x


How can I save and read data on Android?

How can I save and read data on Android?

more ▼

asked Feb 11 '11 at 10:52 AM

Ricardo Arango gravatar image

Ricardo Arango
628 10 13 26

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

1 answer: sort voted first

You can use the PlayerPrefs class of Unity to store Ints, Floats and Strings. The documentation for this is at: http://unity3d.com/support/documentation/ScriptReference/PlayerPrefs.html

If you need to store your own data types you can use http://System.IO classes of the .net (mono) library. The actual paths that you can use are located at Application.persistentDataPath and Application.temporaryCachePath.

You application needs to have permissions in the AndroidManifest.xml to write to storage. That can be set in Player Settings -> Android Tab -> Other Settings -> Configuration -> Force SD-Card permission.

more ▼

answered Feb 11 '11 at 10:52 AM

Ricardo Arango gravatar image

Ricardo Arango
628 10 13 26

(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:

x2458
x436
x436
x24
x5

asked: Feb 11 '11 at 10:52 AM

Seen: 10086 times

Last Updated: Feb 11 '11 at 10:52 AM