Cross-platform Mobile App with HTML5

utvecklare picture utvecklare · Jul 11, 2012 · Viewed 9.1k times · Source

I was asked to provide a tablet application with HTML5/JS/CSS which does not have dependency on any platform. Requirements:

  • Cross-platform mobile/tablet application
  • Offline capability and Storage (it should work in lack of internet connectivity and be able to synch after get connected)
  • Real-time data (it should be able to show any small changes from sensor values)
  • I should be able to connect to a CAN interface and get sensor values and ECU data. Because I have not come up with any solution for this part, I am thinking about Bluetooth. However, HTML5 doesn't support Bluetooth.

I'd appreciate to give me some vision if HTML5/JS/CSS can deal with this requirements (especially with Bluetooth)

Another question is that is it possible not to use any frameworks such as PhoneGap, RHoMobile, .... and just develop cross-platform app with raw HTML5/CSS/JS and have all requirements?

Answer

Matt Gifford picture Matt Gifford · Jul 11, 2012

Have you looked in to PhoneGap / Cordova yet?

You can easily create cross-platform mobile applications using HTML5, JS and CSS.

http://phonegap.com

The built-in API provides access to most of the device's native features and functions. You can manage offline storage using localStorage or SQLite databases, and can detect network connectivity statuses to determine if you are offline / online and what level of connection you have (Edge, 3G, 4G, WiFi). With a combination of those, you could manage your data synchronisation.

As for bluetooth, the PhoneGap API doesn't support it out of the box, but it is highly extensible so developers can create their own plugins for missing or required functionality.

The community is awesome and many of the plugins have been compiled into a central repository on GitHub: https://github.com/phonegap/phonegap-plugins

I know that there is a Bluetooth plugin for Android available on that repository.

You can also write your own plugins quite easily to add any extra features that you need:

http://www.adobe.com/devnet/html5/articles/extending-phonegap-with-native-plugins-for-android.html

http://www.adobe.com/devnet/html5/articles/extending-phonegap-with-native-plugins-for-ios.html

** EDIT **

You posted an amendment to the question afterI'd written this answer mentioning PhoneGap. The honest answer is no, without a framework that interacts with the native device functionality, raw HTML5, CSS and JS would not be able to deal with bluetooth etc.