Big data storage locally or online for an Android app?

Initial publication and first time working on Android, so it's easy if I break any rules :)

In any case, I just got an Android app, and I'm trying to create a simple game for the little things. I plan to ask a lot of questions (I hope about 5000 questions). There was no data manipulation, just read the questions and present them to the user. Now I am faced with a dilemma in how to store questions.

I have two options:

1.) Combine the questions with the application: Perhaps save the information in SQLite. Initially, for demo purposes, I put the questions in an XML file, but I quickly realized how ineffective it would be when the questions started to accumulate. First of all, I am concerned that opening such a huge XML file will load Android memory. Secondly, I'm worried about how big the application will be if it contains 5,000 questions. I read here about the benefits of XML vs SQLite. In this example, the user has 70,000 entries, so maybe my 5,000 questions will be enough?

OR

2.) Ask questions on the server: I believe that the potential of the application should not be associated with a huge number of questions and do not need to worry about the logic of opening and assembling questions. This will simply hit the PHP page and depending on the parameters sent, the PHP page will return the questions in XML format. The disadvantage is that the user needs to be online (to get answers to questions) in order to play the game, and my server must be up and running 24/7.

Has anyone encountered this design problem of how and where to store a huge amount of data in an Android application?

Thank you, any help would be greatly appreciated!

+6
source share
2 answers

From a marketing point of view, I think the right approach is No. 1. Just looking at the list of the best apps, it is filled with apps that work offline. I don’t know why most people do not mention this one important criterion when they talk about marketing applications ... especially on Android, where many people do not have a data plan. In addition, the trivia app is similar to what someone is likely to use when traveling by train, unlike something like Facebook Chat, which they will use when they are online.

From a technical point of view, storing more than 5000 questions really does not take up much space. There, this application is called "MyFitnessPal." It stores perhaps over 30,000 products in the SQlite nutritional information database. Therefore, do not overestimate how much space it takes.

The advantage of the C # 2 transition is that often questions or answers arise, you can go with this approach.

+7
source

I think the best option for you is to store questions in SQLite . This way, users can have access to your game even if they are offline, which is one of the important things Hisoka talked about. So I think you should try using SQLite.

+2
source

Source: https://habr.com/ru/post/897726/


All Articles