英特尔XDK:连接你的手机的应用程序到数据库 [英] Intel XDK: Connecting your mobile app to a database

查看:181
本文介绍了英特尔XDK:连接你的手机的应用程序到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发它,如果我没有一个数据库,建成后的应用程序将是沉重的应用程序。如何将应用程序连接到数据库,无论是本地或远程?

I am currently developing an application which if I don't have a database, the application after building will be heavy. How do I connect the application to a database, either local or remote?

在此先感谢。

推荐答案

您可以使用使用数据库下列方法之一:

You can use one of the following methods for using database:

1使用HTML5客户端数据库。 HTML5提供一个本地客户机上四种不同类型的数据存储的。他们是

1- Using HTML5 client side databases. HTML5 provides four different types of Storage of data on a local client's machine. They are

本地存储。 网络SQL存储。 会话存储 索引数据库

Local Storage. Web SQL Storage. Session Storage Indexed DB

这要看你的需求,你可以使用其中之一。如果你需要一个持久的数据库,少节约值大于5 MB,我建议你的localStorage的实施,这是非常容易的。关闭或重新保存在HTML5 localStorage的数据将不会被删除,即使在手机。这些数据将被删除,只有当您通过localStorage.removeItem()将其删除;客户端数据库没有或者建议,如果你有大量的数据需要,你应该展现给大家谁使用在世界上这个应用程序的中央数据库。在这种情况下它的更好,你使用服务器端的数据库

It depends on your demands you can use one of them. If you need a persistent database for saving values less than 5 Mb, I recommend you LocalStorage as implementation of that is very easy. The data you saved in HTML5 localstorage will not be deleted even in case of phone shut down or reset. The data will be deleted only when you remove it by localStorage.removeItem(); Client side database is not recommended if you have huge amount of data or you need a central database which you should show to everybody who use this app in the world. in these cases its better, you use server side database

您可以阅读一个有关如何使用HTML5在XDK网站本地数据库非常漂亮的文章: <一href="https://software.intel.com/en-us/articles/html5-local-storage">https://software.intel.com/en-us/articles/html5-local-storage

You can read a very nice article about how to use html5 local databases in XDK website: https://software.intel.com/en-us/articles/html5-local-storage

2 - 您可以使用服务器的数据库如MySQL和SQL服务器。但是你需要连接你的HTML codeS到PHP或asp.net脚本中的服务器通过AJAX。您可以使用JSON从PHP传输数据,服务器端的客户端,以JS。

2- You can use server database like MySQL or SQL server. however you need to connect your html codes to a PHP or asp.net script in a server by AJAX. You may use JSON for transfer data from PHP in server side to JS in the client side.

3,您可以像使用Parse.com云数据库但也有一些限制,取决于您选择的定价计划。

3- You can use cloud databases like Parse.com however there are some limitation depends of pricing plan you choose.

这篇关于英特尔XDK:连接你的手机的应用程序到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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