phonegap - sqlite 或索引数据库? [英] phonegap - sqlite or Indexed DB?

查看:27
本文介绍了phonegap - sqlite 或索引数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是从 phonegap 开始的网络开发人员.我需要为 iPhone、Android 和 Windows Phone 8 创建一个应用程序.
我需要在本地存储一些数据(对于 localStorage 来说太大了).
我不知道女巫解决方案是最好的:

I am web developer starting with phonegap. I need to create one app for iPhone, android and Windows Phone 8.
I need to store some data (too big for localStorage) locally.
I don't know witch solution is the best:

  1. Phonegap 提供存储(基于 WebSQL - 已弃用),但 Windows Phone 不支持.有没有插件可以填补这个空白?
  2. 我读过索引数据库,但我以前没有使用过它,它对我来说不是很直观.我不确定它是否在所有平台上都得到完全支持?我基于 (http://blog.nparashuram.com/2012/10/indexeddb-example-on-cordova-phonegap_12.html)
  3. 或者我可以使用 phonegap 插件 https://github.com/marcucio/Cordova-WP-SqlitePlugin 用于 Windows 手机和 https://github.com/marcucio/Cordova-SQLitePlugin for android 和 iphone..那么我的代码在所有平台上都会和我想象的一样.
  1. Phonegap provides Storage (based on WebSQL - which is deprecated), but it is not supported by windows phone. Is there any plugin to fill this gap?
  2. I read about Indexed DB, but I haven't used it before and it is not very intuitive for me. I am not sure if it is fully supported in all platforms? I based on (http://blog.nparashuram.com/2012/10/indexeddb-example-on-cordova-phonegap_12.html)
  3. Or maybe I can use phonegap plugins https://github.com/marcucio/Cordova-WP-SqlitePlugin for windows phone and https://github.com/marcucio/Cordova-SQLitePlugin for android and iphone.. Then my code would be the same in all platforms as I suppose.

之前有人创建过这样的应用程序吗?我会很乐意提供任何解决方案或想法.

Did someone create such an app before? I would be greatful for any solutions or ideas.

推荐答案

Cordova WP8 仅支持 IndexedDB.仅限 iOS 和 Android WebSql.由于 WebSql 已被弃用(我知道有多少人喜欢/使用它并同意在许多情况下 WebSql 非常酷)我建议继续使用 IndexedDb 并为 Android/iOS 使用以下 polyfill.

Cordova WP8 supports IndexedDB only. iOS and Android WebSql only. Since WebSql is deprecated (I know how many people love/use it and agree that in many situations WebSql is very cool) I would recommend to proceed with IndexedDb and use the following polyfill for Android/iOS.

用于 IndexedDB 的 PhoneGap polyfill,使 IndexedDB API 能够与 WebSQL 一起使用

示例

这篇关于phonegap - sqlite 或索引数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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