java - How to populate a large sqlite database on first run -
i'm working on dictionary app based on sqlite database on 300,000 rows.
the problem database file in final form consists of full-text indexed tables , weighs on 150mb.
i've managed bring .db file size minimum creating contentless fts4 tables. the database cannot smaller. managed put pre-populated database in app , works fine.
the problem can't keep final .db file in /assets , copy sdcard on first run because it's big. don't want download on first run.
bulk insert
ing data, transactions , sqlite optimized , no indexes @ start takes forever it's not option.
the thing raw data used build database, in csv format , compressed, 30mb , sqlite's command line .import
option fast (100,000 rows in ~1s) but... can't accessed app without root permissions.
i love bundle app compressed csv files in /assets, decompress them, create database on sdcard , import csv seems me impossible. although there many dictionary apps appear doing this. (the downloaded app dozen megabytes, builds database on first run, , takes hundreds of megabytes of space on sdcard).
how accomplish this?
i've been working on past 2 weeks , ran out of ideas. i'm new android development appreciated.
- plan a: ship compressed sqlite database file , decompress after installation; should able omit indices , rebuild them later.
- plan b: copy relevant parts of csv importer application, ship compressed csv file , load empty database command line tool would. official documentation page.
Comments
Post a Comment