문제

I'm using cordova 3.4.0 and the sqlite plugin (https://github.com/brodysoft/Cordova-SQLitePlugin) to develop an android app with a prepopulated database. I configured the plugin and the database following this post: http://www.corporatezen.com/2012/11/shipping-prepopulated-database-phonegap/

The problem is that the first time the app is launched, it copies the database from the assets folder to the database folder and on old devices with android 2.3.x it can take more than 10 seconds (I have a 90MB database). During this time the screen is black and users may think the app doesn't work and close it.

I tried to look for a faster way to copy the file, but I couldn't find anything. I tried also to set a splashscreen, using the splascreen plugin (https://github.com/apache/cordova-plugin-splashscreen/blob/dev/doc/index.md) but it appears only after the black screen phase.

Do you have any suggestion?

도움이 되었습니까?

해결책

Solved with this plugin: https://github.com/an-rahulpandey/cordova-plugin-dbcopy

With this, the java code to copy the db is called by the plugin and it's easier to show to the users a warning message created with HTML & Javascript.

다른 팁

I also agree with Sergio.
"dpcopy" is a simple, but a powerful tool.
https://github.com/an-rahulpandey/cordova-plugin-dbcopy

And I also recommend you to apply "Cordova-sqlite-evcore-extbuild-free."

Currently, I'm designing my apps with Cordova, IONIC in Visual Studio 2015 and I applied those two plugins above for prepopulated DB.

The following Git also will solve your question.
https://github.com/ymochi/prepopulated-DB-for-hybrid-applications

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top