# 3rd July Report ## Progress **09:00** Entering into lab, setting up my desk ### Storage for store local data - Searching for how to save/store data into local storage - Get three option (based on [Ionic Storage](https://ionicframework.com/docs/building/storage)): - IndexedDB - WebSQL - localstorage - **14:00** Testing Cordova App Preference - Store local data into user preferences, like shared preferences in Android App. - Having issue that cordova provider cannot be launch in simulate system. - This makes the preferences cannot work unless in real device, means that must be built first, and cancelled as idea to store local data. - **16:00** Testing Cordova local storage system - How to configure in NPM (NodeJs) ``` npm install -g cordova ionic cordova plugin add cordova-sqlite-storage npm install --save @ionic/storage ``` - Import the library into app.module.ts ```=typescript import { IonicStorageModule } from '@ionic/storage'; @NgModule({ ... imports: [ ... IonicStorageModule.forRoot() ], ... ``` - Test with testing page, import the library and add into constructor ```=typescript import { Storage } from '@ionic/storage'; export class TestStoragePage { constructor( private storage: Storage ) { } } ``` - Using to store data ```=typescript this.storage.set('name', 'Max'); ``` - Call the data to log ```=typescript this.storage.get('name').then((val) => { console.log("My name: " + val); }); ``` - Result in console: <center> <img src="https://raw.githubusercontent.com/aru1702/images/master/ntust-documentation/18-01.JPG" style="max-height:300px" /> </center> <br> ### Helping my teams with their work - **11:00** While doing searching about how to store local data, I also helping my teams to code the front end for PWA page. - Helping with process the data from API to use in back end code (typescript). - Helping with the using loop for display the data into front page (HTML). **18:30** Leaving the lab ###### tags: `on-intern`