存储 Android SQLite [英] Store Android SQLite

查看:27
本文介绍了存储 Android SQLite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 sqlite 数据库,该数据库将从最初有 1000 条记录的网络服务中填充,然后每次需要时我都会在其中插入更多记录.我的问题是将sqlite数据库存储在设备中的何处以保持插入(在内部或外部存储器中)即如果我将数据库存储在内部存储器中并且当内部存储器被填满时我可以将其移动到外部并继续插入如果我将它存储在外部存储中并且外部存储被填满并且内部有可用空间我可以移动到内部并继续插入数据..我对此感到非常困惑你能帮忙吗我任何建议或链接请

I have a sqlite database that gonna be filled from a webservice with intially 1000 record , then i will insert more record in it each time i need to do. my question is where to store the sqlite database in device in a way to keep inserting ( either in internal or external memory) i.e if i store the database in internal memory and when a internal memory get filled i can move it to external and keep inserting OR if i store it in the external storage and the external storage get filled and there is an available space in internal i can move to internal and keep inserting data .. i am very confused about this can you help me any suggestion or links please

推荐答案

以下答案我是根据我的个人经验给出的.

Following Answer I am giving on the based on my personal experience.

  • 第一条建议(内部/手机内存)

当您将数据库存储在内部存储器中时,它的性能非常好.因为您的应用程序将安装在内存中,因此在插入 1000 条记录和其他记录时,应用程序访问数据库会更容易.应用程序的性能会非常好.但是当谈到内存限制时,当内部内存被填满时,你的设备性能就会下降.所以内存最好到中级数据库.

When you are storing database in Internal Memory, then for the Performance it is very good. Because your Application will be installed in the Internal Memory, so while inserting 1000 Records and other record ,for the application it would be more easier to access the database. Application's performance will be very nice. But when it comes to Memory limitations, when Internal Memory will get filled more than enough then your device's performance will be down. So Internal Memory is best till medium level database.

第二个建议(外部存储器、SD 卡)

当您将数据库存储在 SD 卡等外部内存中时,那么在性能方面,应用程序的性能会比内部内存慢一些.然而,这对于中级数据库来说并不重要.当数据很少时,两种情况下的性能将相同.现在,当您使用外部存储器时,您将拥有大量数据存储.我不认为它永远不会被完全填满.但是在大量记录的情况下性能会下降.有时应用程序可能会崩溃.

When you are storing database in external Memory like SD Card, then for performance , application performance’s will be bit slower than Internal Memory. However this won't be significant for medium level database. When there is very few data then performance will be same in both the cases. Now when you are using External Memory, then you have large size of data storing. I do not think it will never get filled fully . But in case of large number of records performance will be down. Sometimes it may be possible that application crashes.

这篇关于存储 Android SQLite的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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