Krigan
Krigan

Reputation: 31

What is the best way to store static data for an android application?

I'm coding a card game app on android, with no game engine, just a simple android application.

The thing is : I want to store all the cards value of the game, and I don't know how. Should I use a database like SQLite and store all my cards commonly to all users, or should I store the cards on the user's device by serializing some Json?

I'm talking about best practices, but also about features possibilities : I will be able to add cards to all the users by just updating the database, but if it's stored on the user's device, they will be able to create and edit cards easily.

Thanks for your help, I'm going back to my thinking cave.

Upvotes: 0

Views: 911

Answers (2)

Rob Gas
Rob Gas

Reputation: 56

We have 3 ways to save data

  1. Save in db
  2. Write on file
  3. Write in shared preferences

https://developer.android.com/topic/libraries/architecture/datastore

Check out this link for more details. :)

Upvotes: 1

mehdim2
mehdim2

Reputation: 129

It's more professional, more secure and you can update the data easier when you create an api. But if it's not a heavy and a static data you can stock in the user's device.

Upvotes: 0

Related Questions