I am stumped on how to load a large amount of data at the initial creation of my database. I am using the embedded SQLite to build about 4 tables, where 3 tables are on avg 6000 rows of data. I read in from a text file and the parse each line into String[] based on delimeters, so I can create/execute INSERT statements. Once I get the database loaded my queries and updates work like champ (even for slow PC), but the initial load is a killer. I have to wait 30mins - 1hr before all data is loaded. Thats not good!
Here is an example of I read in ...
Using java Syntax Highlighting
- InputStream inputStream = ctx.getResources().openRawResource(R.raw.item_list);
- BufferedReader br = new BufferedReader(new InputStreamReader(inputStream), 1016688); //1016688 max
- while ( (buffer = br.readLine()) != null)
- {
- String[] s = buffer.split("\\^");
- // Build INSERT...INTO statements and execute them.
- }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4
Is it possible to load a prebuilt SomeDB.db file into an Android application? ... or something ...
If possible, my goal is to avoid hitting a database from an external location via web application server, etc., at least for the initial load.
Thanks!
gilgantic

