Posts

Showing posts with the label cordova

Ionic 1 Cordova Files (persistent)

Image
Objective 1. To use window.requestFileSystem 2. To use window.PERSISTENT type of storage 3. To implement file create, read, write and delete. References 1.  https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html 2.  https://www.html5rocks.com/en/tutorials/file/filesystem/ 3. Codes samples adapted from:  https://www.tutorialspoint.com/cordova/cordova_file_system.htm 0. Add Cordova cordova plugin add cordova-plugin-file 1. HTML View <button ng-click="cdv('create-file')" class="button button-positive button-block">create-file</button> <button ng-click="cdv('write-file')" class="button button-positive button-block">write-file</button> <button ng-click="cdv('read-file')" class="button button-positive button-block">read-file</button> <button ng-click="cdv('remove-file')" class="button button-po...

Ionic 1 Cordova Files (temporary)

Image
Objective 1. To use window.requestFileSystem 2. To use window.TEMPORARY type of storage 3. To implement file create, read, write and delete. References 1.  https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file/index.html 2.  https://www.html5rocks.com/en/tutorials/file/filesystem/ 3. Codes samples adapted from:  https://www.tutorialspoint.com/cordova/cordova_file_system.htm 0. Add Cordova cordova plugin add cordova-plugin-file 1. HTML View <button ng-click="cdv('create-file')" class="button button-positive button-block">create-file</button> <button ng-click="cdv('write-file')" class="button button-positive button-block">write-file</button> <button ng-click="cdv('read-file')" class="button button-positive button-block">read-file</button> <button ng-click="cdv('remove-file')" class="button button...

Ionic 1 Call Cordova Plug Ins

1. HTML <button class = "button" ng-click = "callCordova()"> Call Cordova Plug In</button> 2.JS function($scope, $stateParams) {     var cdv = function(options) {         console.log('begin cdv');         document.addEventListener("deviceready", function() {             console.log('deviceReady');             /*cordova task begin*/             /*cordova task end*/         }); /*device ready*/     } /*cdv*/ }/*controller*/