Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by guitarninja · Nov 03, 2013 at 09:23 PM · androidgame save

How do you enable saving on android?

I'm able to save all and any data I wish on multiple OS's however if I transfer the content on to an Android device the game will run perfect but my data isn't saved.

Do I have to enable something android specific for it to save data?

If I install the app on an android device it states that the app has permission to save data so I can't see where I am going wrong.

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mattssonon · Nov 04, 2013 at 08:24 AM 0
Share

How are you saving your data?

avatar image tanoshimi · Nov 04, 2013 at 08:30 AM 0
Share

In my (admittedly limited) experience, saving data using PlayerPrefs in Android works exactly the same as on other devices.

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by MrSkiz · Nov 04, 2013 at 04:34 PM

Yes PlayerPrefs work on Android, I can set ints and strings on my project at runtime, and get them in another run.

But on Android PlayerPrefs are stored on an area of the device's memory not accessible if the device isn't rooted, so I think you can't simply copy/paste saved datas from one platform to Android.

So if your plan is to import datas from another platform, you should consider export these as text files or such and parse them at runtime in your Android build.

On Android, external files are/can be stored on "Your Device/Internal Memory/Android/data/com.[Your Company Name].[Your App Name]/files" (well at least it's the path for my HTC One X)

Don't forget that PlayerPrefs are also resetted each time you rebuild/reinstall the apk.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image guitarninja · Nov 04, 2013 at 09:01 PM 0
Share

I've been saving my data as a custom class and not using PlayerPrefs, forgot all about them in fact. I'm now using a combination of PlayerPrefs and my custom class save method and it works perfectly.

Your answer

Hint: You can notify a user about this post by typing @username

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

Answers Answers and Comments

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android Error 0 Answers

Google Game Services Not workng 0 Answers

Android app crashes when launching a second UnityPlayerActivity from Unity5 0 Answers

Sending email from within Unity using smtp service 1 Answer

How is the porting (PC->Android/iPhone) done? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges