Javascript and Sqlite - javascript

I am creating an app using HTML5 and Javascript. This app will be compatible with Windows and iOS 6 (iPad). I need a local database access using javascript. This is a pure offline ap with no server side involved.
My dilemma is -
WebSQL is not supported anymore by W3C.
IndexedDB works with Firefox but not with iOS6.
Most importantly, I want to avoid HTML5 Local database storage as it cleans data whenever history is cleared.
I would like to have a durable database locally for the app, something like SQLite. Is it possible to access SQLite using pure javascript, so that it will work with Firefox on Windows and also on iPad.
EDIT: The app will not be run from the browser in iPad (iOS6). Rather the app will be packaged into ipa file and installed in the iPad device.

What you're looking for is a polyfill.
According to HTML5 Please, IndexedDB Polyfill implements the IndexedDB APIs over WebSQL. (The author of the polyfill also wrote an article on Mozilla Hacks about it.)
Facebook also as a polyfill. According to this pull request (to another project), Parashuram Narasimhan, the author of the first polyfill, seems to prefer the Facebook polyfill and is considering retiring his own project. (But then again, the Facebook repo looks like a one-time code dump and may not have any ongoing development.)

There are some points to note.
Its a pure client side app.
Not using webstorage (local and session)
The options left are using webSQL, IndexedDB, Third-party framework or custom solutions.
webSQL :- Support is limited to webkit browsers and w3c declared its dead. Browser support
IndexedDB :- Supports in IE10, chrome and Firefox. Browser support. Not supported in older versions of IE.
Third-party framework :- sequelsphere is a platform independent solution to address this issue. It is a RDMS written entirly in javascript and make use of webSQL or IndexedDB.
custom solutions :- Supporting both IndexedDB and WebSQL on a cross platform web app like this tutorial, we can create our custom cross-browser db solutions or may use lawnchair like json storage options.

We had same issue and got answered on this thread.
Lawnchair is a good choice if you need a single table DB - we had requirement of multiple tables, so have developed own wrapper.
Create a web app using HTML-5 and JavaScript, so that it can work for both desktop browser and
iPad. Make it hybrid using PhoneGap for making it iPad's native app.

Please check whether this might be helpful. you can use javascript for both front-end and back-end (for db interactions). There are so many plugins also available to use for this framwork. http://www.nodejs.org

It's 100% possible. I can recommend a javascript lib for data access in html5 sqlite.
Documentation & sample code: click here
I have made a android demo (by using phonegap) with that lib. It works great!
Download the demo here

Related

Using nosql for a browser extension?

I'd like to have a backend for my chrome/firefox extension app which makes queries to a local (preferably nosql) database. Is there any way to do this? Perhaps a query language for accessing chrome.storage?
read about html5 storage in particular indexedDb and web sql. those are the only possible ways to query storage (ok well the html5 filesystem api is also a way that could be considered indexed by using folders).
All three work well in chrome. Make sure to use them from the correct location (background script). Havent tried with other browsers, check their html5 compatibility.
Even if you use something specific of Chrome, both Firefox and Edge recently promissed supporting chrome extensions by just repackaging them for their store.

how can i access scanner and scan document using java, jquery or javascript

How can i access scanner and scan document using java, jquery or javascript.Please give me a solution..
I have tried with aspire scanner.js .But while using with chrome version 42, it shows like no longer support java extention.
I would like to implement scanning for web applications.
Please let me know if there any solution..
Thanks in advance
Chrome 42 is supported by Scanner.js. You may try out scanner.js's html5/JavaScript web browser based scanning demo here.
Scanner.js supports both NPAPI browsers (like Chrome 44 and lower, IE, Firefox, Opera) and Non-NPAPI browsers (Chrome 45+, Edge).
When running Scanner.js from NPAPI browsers, it attempts to use a Java applet so that no software is required to install. As for non-NPAPI browsers, scan app is required.
There are two ways to make JavaScript work for scanning documents:
JavaScript API provided by web browser. For example, in ChromeOS, you can easily use JavaScript API to access scanner.
Establish a communication mechanism between scanner service and web client JavaScript API. For example, Dynamic Web TWAIN runs a service to access document scanners and transfer document images to JavaScript via websocket.

Cross-platform Mobile App with HTML5

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?
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.
No, you cannot. A pure web application is not able, and will likely never be able, to use bluetooth.
HTML5 Bluetooth and Audio
Having developed a Web App before, I can tell you that anything involving offline has to be simple, and using device hardware is out.
Check out the frameworks, you may be able to get something to work. But it may just be a better/more realistic bet to develop a Native Application from the get go.
After a lot of searching I came up with MoSync which is a cross-platform SDK and is intended for developing different mobile applications. I believe MoSync can be the best answer for this question since it is really a rich SDK (C, C++, HTML, JavaScript) and has great tools and community that try their best to help you.
For further information I encourage developers to check here or visit their websites.
Most of the future mobile apps will be developed using HTML5. HTML5 standards are getting adopted very rapidly and those standards are supporting phone features like GPS, Accelerometer, Camera, Storage etc.
I will recommend you to use PhoneGap if you want to use any device features.

How to create javascript interface for ios application obj-c?

does anyone know how to create a javascript interface in iOS that can be called from javascript? My aim is to save data from a website in a native fashion and not using html5 local storage.
If I understand correctly, what you need is a mobile webapp packaging solution.
The most popular here is, perhaps, PhoneGap, it supports many platforms including iOS. The product is free and open source. You will still need to use Apple's iOS platform SDK and have a developer account. As for storage mechanism, I believe PhoneGap has a solution for it (allowing the storage to be persistent, not cleared out like browsers' localStorage).
If you want to simplify your deployment process, you may want to check out appMobi, they build on top of PhoneGap, providing their own development kit and cloud deployment services.
Also refer to this thread that discusses different kits:
Comparison between Corona, Phonegap, Titanium
UPD. Have you tried the PhoneGap SQLite plugin for storage?

Developing a cross-platform self-contained HTML application

I am thinking of building an application, kind of like TiddlyWiki in the sense that everything is self-contained in an HTML file, or at least in a bundle where a user won't have to install anything. It works on just about any browser, and on mobile phones (Android and iPhone), and in some browsers (e.g. Firefox), manages to save to the local filesystem without a plugin (albeit, it launches many security warnings, but there are other solutions for that). Other browsers happen to use a Java plugin to bypass this restriction.
Are there any technologies that exist that make this possible? HTML5's web storage sounds like it would be almost perfect, except that the data would be tied to the browser.
Any assistance would be appreciated (even if that just means editting / retagging the question to get more folks looking).
Whats about the fileapi: http://caniuse.com/#search=fileapi
I am just adding a relevant comment with this but not exactly an answer...
When you are saying that you want to develop application which contains everything... Then I would like to add about Titanium, PhoneGap, and others (Corona)...
This softwares provides JavaScript base which will be running on all the mobiles (if mobile applications), desktops (if desktop applications) and so on.... But Titanium (as i am working on it) works on the SDK of all the other languages for development...
Now TiddlyWiki, what i have understood from the link is that it is creating a web application or something like that which will work on all the other mobile devices. But this is NOT Good always, Since some application needs to be a NATIVE environment (which is supported by Titanium). Native applications will be much more faster than any other developed applications..

Categories

Resources