请问有什么办法可以使用​​从Xamarin一个pre-现有的数据库从没有抄袭的资产呢? [英] Is there any way to use a pre-existing database from Xamarin without copying it from Assets?

查看:219
本文介绍了请问有什么办法可以使用​​从Xamarin一个pre-现有的数据库从没有抄袭的资产呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当大的SQLite数据库(约20 MB),我需要从我的Andr​​oid Xamarin窗体应用程序来访问。

I have a rather large SQLite database (~20 mb) I need to access from my Android Xamarin-Forms app.

在网上的一切我读过说,你可以先复制到文件系统中读取数据库。例如,这个问题。但是,不就是意味着大型数据库被复制,浪费了用户的precious空间的(和近一倍我的应用程序的足迹)的?

Everything online I've read says you can read the database by copying it to the filesystem first. For example, this question. However, won't that mean the large database is duplicated, wasting users' precious space (and nearly doubling the footprint of my app)?

必须有办法直接从资产读SQLite数据库,或者使用其他一些方法来捆绑我的应用程序的数据库不会浪费这么大的空间。但我怎么能做到这一点?

There must be a way to read the SQLite database directly from the assets, or use some other method to bundle the database with my app that won't waste so much space. But how can I do this?

推荐答案

您不想从资产使用它,即使你可以,因为资产是一个COM pressed只读文件,您的安装的一部分。你不能写更新到它,它可以杀死90%的数据库使用。而其低效的阅读作为其压缩了。所以,你真的需要复制它。如果你担心磁盘空间,可考虑从网络上下载它,而不是保持它在你的apk。

You don't want to use it from assets, even if you could, because assets is a compressed read only file, part of your installation. You can't write updates into it, which kills 90% of database use. And its inefficient for reading as its zipped up. So you really do need to copy it. If you're worried about disk space, consider downloading it from the web rather than keeping it in your apk.

这篇关于请问有什么办法可以使用​​从Xamarin一个pre-现有的数据库从没有抄袭的资产呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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