Now that we've gone through the File API, Promises, and YASMF's FileManager
, it's time to update our NoteStorage
model to support the new storage mechanism. Almost nothing else needs to change. The look and feel of the app will still function in the same way, but it will use the filesystem for storing notes instead of LocalStorage
.
Android versions prior to 4.4 (KitKat) don't natively support easy creation of Blob
—what we use to save files to storage. In order to fix this, we need to create a polyfill that will provide this support without having to make changes to the rest of our code.
To do this, create a new file at www/js/lib/Blob.js
:
// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // last line modification by Kerri Shotts for PhoneGap Hotshot try { new Blob([]); } catch (e) { var nativeBlob = window.Blob; var newBlob...