My previous app has the same problem like this. I give you the solution that I did:
- Before release your app, you should embed the latest database (imported by json, call
db1
) in asset folder, then copy it into application database folder (something like/data/your.package/databases
) when initializing app, it only takes some seconds. By this way, you can query data and check user login/register normally. - Whenever device comes to internet, you just download the latest json data and import it into another database file (call
db2
) on background.If this progress doesn't have any errors, you can replacedb1
file bydb2
and it can work properly.