适用于PhoneGap数据库存储的内容 [英] What to Use for PhoneGap Database Storage

查看:134
本文介绍了适用于PhoneGap数据库存储的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PhoneGap编写应用程序,我发现很难解决如何将我的数据存储在数据库中。对于这一分钟,我只是想保持开放的心态,因为我会向我们的公司推荐技术选项。

I am writing an application using PhoneGap, and am finding it hard to work out how to store my data in a database. For the minute I just want to keep an open mind as I will be recommending technology options to our company.

PhoneGap API的存储在这里,

The PhoneGap API for storage is here,

http://docs.phonegap.com/ en / 1.3.0 / phonegap_storage_storage.md.html#Storage

这是基于此HTML5规范,

It is based on this HTML5 spec,

http://www.w3.org/TR/webdatabase/

我的问题是,这个规范不再被维护,标准已被弃用。

The problem for me is that the specification for this is not being maintained any more, and the standard has been deprecated.

问题是我使用web数据库实现了一个数据库,并且版本控制不能正常工作。

The other problem is that I implemented a database using web database, and the versioning didn't work properly.

PhoneGaps的立场是什么,PhoneGap会考虑其他技术索引数据库API

What is PhoneGaps stance on this and will PhoneGap look at other technologies such as the Indexed Database API,

http:// www .w3.org / TR / IndexedDB /#database-concept

我现在将JSON数据存储在localStorage中,现在运行良好,但我

I am storing JSON data in the localStorage for now which is working great, but I am wondering if my database could get too big and it might not be the best option.

推荐答案

我遇到了类似的问题,同时开发一个应用程序几个月前,我们期望将应用程序移植到不同的平台(具有不同的版本)。因此,我们使用一个专门的存储框架,可以提供一致的API,但使用最好的底层存储机制,而不是使用phonegap提供的核心存储机制。

I faced the similar issue while developing an application few months back in which we were expecting to port the application to different platforms (with different versions). So instead of using the core storage mechanism which phonegap offers we went on using a dedicated storage framework which can provide consistent api but uses the best underlying storage mechanism.

的JS框架,可以帮助您使用底层存储。如果您计划在不同平台上使用该应用,以下几个人可能会感兴趣。

There are variety of JS frameworks which can help you use the underlying storage. The following are few might interest you if you are planning to use the app on different platforms.

PersistenceJS - persistencejs.org

PersistenceJS - persistencejs.org

lawnchair - http://westcoastlogic.com/lawnchair /

lawnchair - http://westcoastlogic.com/lawnchair/

persistencejs结合使用齿轮和本地存储,有助于在BlackBerry 5.x设备上运行应用程序,而且不会有任何更改。

persistencejs uses gears and localstorage in combination which helps to run the app on BlackBerry 5.x devices as well without any change.

我继续使用persistencejs,它真的工作得很好,直到现在。我们已将应用程序移植到Android,iPhone,iPad,BlackBerry(5.x及更高版本)上。

I went on using the persistencejs and it have really worked well till now. We have ported the application on Android, iPhone, iPad, BlackBerry (5.x and greater)

这篇关于适用于PhoneGap数据库存储的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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