Android的工作室连接与现有的SQLite数据库 [英] Android Studio connect with existing SQLite database

查看:151
本文介绍了Android的工作室连接与现有的SQLite数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有SQLite数据库一个​​应用程序,然后我创建另一个应用程序,可以连接到我创建了一个数据库,我的问题是,是否有可能连接现有的数据库不会复制一次?如果可能的话任何一个可以给我一个样品code连接现有数据库。我的数据库的名称是SEIS和表是Proinfo。

i have one application with SQLite database and then i create another application that can connect to the database that i created one, my question is, is it possible connect the existing database without copying the existing once ? if possible can any one give me a sample code to connect my existing database . the name of my database is "SEIS" and the Table is Proinfo .

推荐答案

是的,它是可以通过使用内容提供商。根据文档:

Yes it is possible through the use of content providers. According to the documentation:

一个内容提供商管理访问数据的中央存储库。提供者是一个Android应用程序,它通常提供自己的用户界面与数据工作的一部分。但是,内容提供商的主要拟由其他应用,它使用接入提供商客户对象提供者使用。

A content provider manages access to a central repository of data. A provider is part of an Android application, which often provides its own UI for working with the data. However, content providers are primarily intended to be used by other applications, which access the provider using a provider client object.

我建议你阅读下面的文章:

I suggest you read the following articles:

http://developer.android.com/guide/topics/提供商/内容providers.html

http://www.tutorialspoint.com/android/android_content_providers.htm

这篇关于Android的工作室连接与现有的SQLite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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