在的openDatabase服用SQLCipher Android版时间: [英] opendatabase in SQLCipher taking time Android:

查看:278
本文介绍了在的openDatabase服用SQLCipher Android版时间:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用SQLCipher它工作正常。我有这个的openDatabase 方法的一个性能问题。我的code是

I am using SQLCipher it is working fine. I have one performance issue with this openDatabase method. My code is

SQLiteDatabase database = SQLiteDatabase.openDatabase(databasePath,
                databasePassword, null, SQLiteDatabase.OPEN_READWRITE);

这也工作正常。但我的问题是,它需要3到4秒的时间(我发现时间滞后logcat中)。由于这种活动展示响应速度慢。

This also working fine. But my problem is it takes 3 to 4 seconds time (I found time lagging in Logcat). Because of this the activity show slow response.

注意:
我打电话从设置在的onCreate 此方法code 的setContentView(R.layout._list);

我这样做对吗?是否有任何其他的方式来打开数据库。

Am i doing right? Is there any other way to open database.

是不是从的onCreate

推荐答案

我解决我的问题。一旦我的应用程序打开,我打开我的数据库并保存(静态法)从所有的活动打开它 。我不知道这是正确的方式与否。但它解决了我的问题。

I have solve my problem. Once my application is open i've open my database and save that (static method) open it from all the activities. I am not sure which is the right way or not. But it solve my problem.

这篇关于在的openDatabase服用SQLCipher Android版时间:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆