简体   繁体   English

适用于Android用户的公共SQLite数据库

[英]Public SQLite Database for android users


If I create an android database using SQLite it will be local, just for the phone in which the database is stored? 如果我使用SQLite创建一个android数据库,它将是本地的,仅用于存储数据库的手机?

And how can I create a database which could be used and updated from different phones? 以及如何创建可以在不同手机上使用和更新的数据库? For example, I have database with friends online and if someone turns on the program then it stores an entry in table which is seen by all of the users friends? 例如,我有一个与朋友在线的数据库,如果有人打开该程序,那么它将存储在表中的条目被所有用户朋友看到?

Maybe, some tutorials on creating remote database (if included database is not public). 也许,一些有关创建远程数据库的教程(如果包含的数据库不是公开的)。 I searched google, but the only thing I found was simple database tutorials, which, as I suppose, are stored in phones memory and that means accessable by just that particular phone. 我搜索了google,但我发现的唯一东西是简单的数据库教程,据我所知,它们存储在手机内存中,这意味着只能通过该特定手机进行访问。

Thank You in advance, 先感谢您,
Daniels 丹尼尔斯

If you wanted to have a remote database that multiple people could connect to you would have to set up something like MySQL or similar. 如果您想要一个可以供多个人连接的远程数据库,则必须设置类似MySQL或类似的工具。 At that point, you would have to set up some sort of API that you could connect through, then you have to worry about access control as well. 到那时,您将必须设置某种可以通过其连接的API,然后还必须担心访问控制。

The most common one I see around is a PHP frontend so that the entire database connection runs over HTTP example here : PHP API 我看到的最常见的是一个PHP前端,因此整个数据库连接都通过HTTP示例运行: PHP API

I believe there is a way to do what you asked. 我相信有一种方法可以解决您的要求。 You can create a web service that will communicate with your local database and store the data of your local db in an online db using synchronization. 您可以创建一个将与本地数据库进行通信的Web服务,并使用同步将本地数据库的数据存储在在线数据库中。 The online db doesnt need to be in SQLite. 在线数据库不需要在SQLite中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM