简体   繁体   English

如何提醒用户有关本地数据库的新更新?

[英]How to alert users on new update to local database?

I'd like to receive some advice from all of you. 我想收到大家的一些建议。

What is the best way for me to alert users on an update to my app? 对于我的应用程序更新提醒用户的最佳方法是什么? My app is a very knowledge-based & it works like a dictionary, so there will always be updates to it. 我的应用程序基于知识,并且像字典一样工作,因此始终会有更新。

The database I have used is by DB Browser for SQLite, and they are all local database where it is uploaded into the assets folder in Android Studio. 我使用的数据库是DB Browser的SQLite 数据库 ,它们都是本地数据库 ,将其上传到Android Studio的资产文件夹中。

Currently, the limitations are that: 当前,限制是:

1) it's obviously not real-time because it's stored locally; 1)它显然不是实时的,因为它存储在本地;

2) every update I make to the database structure, I am required to upload the new database into the assets folder again, followed by uninstalling the old app on my phone, then run the app to install in my phone again so that the new database is overwritten. 2)我对数据库结构进行的每次更新,都需要将新数据库再次上载到资产文件夹,然后卸载手机上的旧应用程序,然后运行该应用程序以再次安装到手机中,以便新数据库被覆盖。

I have read ( How can I regularly update a database of content on an Android app? ) & some others, and it seemed like I have to have a server, a cloud-based database & live app in market, to solve the limitations? 我已经阅读( 如何定期在Android应用程序上更新内容数据库? )和其他一些内容,看来我必须在市场上拥有服务器,基于云的数据库和实时应用程序才能解决这些限制?

Is there really no way for me to overcome the limitations if I want to stick to a local database? 如果我要坚持使用本地数据库,是否真的没有办法克服这些限制? At the same time, I kinda wish to avoid setting up a server because I am not intending to make the app live on market , and also this is just a school project I am working on and as such, I have very limited skill sets & knowledge about it and would like to make it on a school-project-based level. 同时,我有点想避免设置服务器,因为我不打算将该应用程序投放市场 ,而且这只是我正在从事的学校项目,因此,我的技能非常有限&有关它的知识,并希望在基于学校项目的水平上进行。

Thanks in advance. 提前致谢。

One way to do it is to connect to your local DB through local network instead of assets folder. 一种方法是通过本地网络而不是资产文件夹连接到本地数据库。 Therefore, you can update the information by querying the local DB. 因此,您可以通过查询本地数据库来更新信息。

As for syncing the information between DB and your application, you should create a trigger or watcher that notify your application when the DB is updated. 至于在数据库和应用程序之间同步信息,您应该创建一个触发器或观察程序,以在数据库更新时通知您的应用程序。 Therefore, your application can know when to query the DB for the updates. 因此,您的应用程序可以知道何时向数据库查询更新。 Another way is to just query the database periodically. 另一种方法是只定期查询数据库。

Bonus: you could move your database to a cloud-based database. 奖励:您可以将数据库移至基于云的数据库。 Usually there are several providers that provide free database hosting up to a certain size, which should be enough for your project. 通常,有几个提供程序可以提供不超过一定大小的免费数据库托管,这对于您的项目来说已经足够了。

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

相关问题 如果数据是新数据,则仅从Web服务更新本地数据库中的数据 - Only update data in local database from web service if the data is new 更新本地Android数据库 - Update local Android database 将新数据发布到远程服务器时,如何警告Android应用程序的用户? - How do I alert users of an Android app when new data is posted to a remote server? :Noob Alert:同一数据库中的用户如何将彼此添加到他们的“联系人列表”中? - :Noob Alert: How can users in the same database add each other to their 'contact lists'? 如何在Android sqlite数据库中更新新行 - how to update new row in android sqlite database 如何将数据库中的数据更新给我的用户? - How should I update the data in database to my users? Android:如何由用户自己动态创建新的数据库表? - Android: How to create new Database tables dynamically by the users themselves? 如何在Android中使用新数据库文件更新旧数据库文件? - How to update the old database file with the new database file in android? 表中更新时如何将本地SQLite数据库同步到服务器 - how to sync Local SQLite database to server when update in table 如何使用Room Persistence Library从本地数据库更新文档? - how to update a document from local database using Room Persistence Library?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM