Easy way to save values through many appstarts?

后端 未结 1 1809
故里飘歌
故里飘歌 2021-01-17 04:12

is there a way to save values through various starts of an app? I need to save some statistics (records of a game). In objective-c I used UserDefaults, what\'s it in Java? I

相关标签:
1条回答
  • 2021-01-17 04:49

    one line of code

    No, that's not going to happen. But if you just have simple data and not much of it then you can use SharedPreferences

    There is a good, basic example of using SharedPreferences here in the docs

    But if you are going to be storing a lot of data for a game then you probably want to implement an SQLite DB

    See Storage Options for what will work best for you.

    0 讨论(0)
提交回复
热议问题