Monday, September 19, 2016

IndexedDB support in Intel XDK

After describing options for database integration for mobile apps, this post describes a test that you can use to see if your browser supports IndexedDB.

Database for Mobile Apps:
When it comes to integrating mobile apps with databases there are two popular options, SQLite database or IndexedDB Database. While the former is a relational database, the latter is not-it is a storage for key/value pairs.

This post here (http://hodentekmsss.blogspot.com/2016/09/sqlite-using-visual-studio-community.html) describes some details about SQLite database and the process of installing it on your computer.

According to Mozilla Developer Network,
"IndexedDB is a Web API for storing large data structures within browsers and indexing them for high-performance searching. Like an SQL-based RDBMS, IndexedDB is a transactional database system. However, it uses JavaScript objects rather than fixed columns tables to store data."

Complete details of this API are here (https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_APIhttps://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API)

Does Intel XDK support the use of IndexedDB?


Create a Standard HTML page with App Designer 7 (herein Build 3522) support as shown.



Add a HEADER, a Go button and a ifr widget (keep src blank but just add a named id) as shown. When you click the button on this page, it runs a script which finds the id of the "ifr" and set its src to the IndexedDB.HTML.

The script is shown here:

The IndexedDB.html page is shown here:

It sets up the implementation Windows' prefixes and the Windows.IDB objects.

You can verify after clicking SIMULATE by hitting the test button as shown.







Post a Comment