[英]Xamarin Android application database
What is best practice using databases (sql) for android aplication written in c#? 使用数据库(SQL)进行C#编写的Android应用程序的最佳实践是什么?
My first idea is to create database in sql, than create web application with entity framework to read data via json, or write to database with web requests. 我的第一个想法是用sql创建数据库,而不是使用实体框架创建Web应用程序以通过json读取数据,或使用Web请求写入数据库。 Is it good idea?
好主意吗? Any suggestions?
有什么建议么?
Thank you! 谢谢!
It depends.. if you really need a SQL Server database for centralized data you can do as you said. 这取决于..如果您确实需要SQL Server数据库来存储集中数据,则可以按照您所说的做。 I only suggest to expose database throught REST Web Api so you can easy access from Xamarin with standard HttpClient.
我仅建议通过REST Web Api公开数据库,以便您可以使用标准HttpClient从Xamarin轻松访问。
If you only need a device persistence you can look at SqlLite: https://developer.xamarin.com/guides/cross-platform/application_fundamentals/data/part_3_using_sqlite_orm/ 如果仅需要设备持久性,则可以查看SqlLite: https : //developer.xamarin.com/guides/cross-platform/application_fundamentals/data/part_3_using_sqlite_orm/
or you can look at REALM DB here: https://realm.io 或者您可以在这里查看REALM DB: https : //realm.io
Hope it helps. 希望能帮助到你。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.