开发者

where is the best place to save game progress?

开发者 https://www.devze.com 2023-04-08 00:27 出处:网络
I\'m developing a quiz game and I want to save the progress... Actually I use sharedsettings, is easy and fast, but the user can delete program files and lose the progress. Same happens with a databas

I'm developing a quiz game and I want to save the progress... Actually I use sharedsettings, is easy and fast, but the user can delete program files and lose the progress. Same happens with a database. I should use a file? I'm only inter开发者_JAVA技巧esting to save a boolean for each question: "correct answered or not?"

Thank you!!


SharedSettings. And you're already using it. It's very difficult to save a user from his/herself. If it's on the device then it can be destroyed either stupidly or maliciously. And don't forget that everything is a file and there's nothing you can put on the device that will be hack/idiot proof.

The only way to get around this would be to store user settings off the device via something like a web service (and backing database.) But I would say that if you're using SharedSettings... you're OK. Leave it at that. I would only consider using an app-specific db if you expect the number of question you track to grow to a very large size and want more control over the data.


Where in code logic?

In general, it's best to save any UI preferences at onPause. Android design wants you to never have a "save" button, rather save constantly.

As far as at each question, i guess you would save after answering each question?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号