A
A
Andrey2015-05-26 11:58:02
Android
Andrey, 2015-05-26 11:58:02

Filling the database with a large amount of information?

Comrades, I'm interested in someone else's experience or even some best practice, here's the question:
When you first start the application, you need to fill the database with a large amount of text data. Moreover, one of the fields of the table may contain line feed characters. Now it is done in the form of a large footcloth of sql inserts, which are run at the start of the application. Maybe someone knows more civilized ways to implement such a task?
What does the transition to orm activeandroid have to do with it, and there, apparently, it will no longer be possible to just take and drive away a pack of inserts.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
Copperfield, 2015-05-26
@kozinakoff

I did this: a json file with data is generated, the file is thrown into the assets folder. When you first start the application, this file is parsed into the model and then do whatever you want.

E
Emin, 2015-05-26
@Ewintory

You can see how this is done in the Google IO 2014 application, where json is parsed on the first run. Start with the performDataBootstrap method
https://github.com/google/iosched/blob/master/andr...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question