3

For a school project for a real-world client we are being asked to create an app that can work in offline mode to store information into some sort of db, that will then sync that info with an online db when the system has an internet connection (needs to support pc, mac, ios, android, but could possibly be a different app for each system type)

Is HTML5 with Web Storage (local) the best way to go? All the browsers seem to support it so it seems like the best option for online use, but can it even be used to run in an offline mode with no access to the internet? I'm a little lost here.

4

3 回答 3

4

If you have to store content when offline, then the local storage facility of HTML5 is pretty much your easiest shot; you could probably do something with Java or (spit) ActiveX that would let you access to local file system, but why re-invent the wheel ?

Better yet, there already exists libraries that let you sync the 'local' storage to the DB on your website, which should suffice for your offline requirement:

Best way to synchronize local HTML5 DB (WebSQL Storage, SQLite) with a server (2 way sync)

To clarify that, you can code to use local storage and then synchronise that locally stored data to the main database when you're connected.

Considering the many platforms you're going to be targeting, HTML5 may well be the only solution.

于 2011-10-02T23:45:17.653 回答
2

Yes, you are on the right track. Web Storage uses a db on the client side to store information, hence you do not need an internet connection. You can read up more on it here

于 2011-10-02T23:46:02.257 回答
0

有 3 个核心功能需要考虑。

  • 浏览器捕捉
  • 本地存储
  • 本地数据库

您将在以下链接中找到更深入的解释:
http ://www.sitepoint.com/offline-capabilities-native-mobile-apps-vs-mobile-web-apps/

于 2014-07-22T17:16:23.320 回答