value of localStorage in crosswalk lost after restart app - angularjs

I use ionic to create my app.
Because perfomance problem in android device so i have to integrate app with crosswalk,.
My app use localStorage to store many setting info , use it like local variables
My problem is when use crosswalk, each time i restart the app, variable store in localStorage is lost!
After do alot of solution, i try:
https://github.com/ocombe/angular-localForage --> This solution can storage persistent value & variables, but it use promise to get the value, isn't like localStorage way ( just set value for variables, use it synchronize ). So this not my goal, use as localStorage
https://github.com/munisense/cordova-plugin-local-storage-retrieval.git --> A Cordova plugin to be used with alternate browsers to retrieve localstorage from default system browsers --> But when i use this plugin, problem still occur
Some version of framework used in my project:
ionic 1.7.14
cordova 5.4.1
crosswalk 18+
Please help me solve this!

Related

is it possible to create a PWA in angularjs?

I am new to PWA, i am curious to know that is it possible to create a PWA in angularjs?
please provide steps to make PWA using angularjs if it is possible to create PWA using angularjs.
There's nothing framework-specific about PWAs - your site just has to meet a certain set of criteria:
Everything is served over HTTPS
The design must be responsive
Your app must be available offline (i.e. it needs a Service Worker)
You need to provide a manifest file containing metadata about your application
Your app must work in all modern browsers
Page transitions shouldn't block the app (i.e. you need to show loading screens/spinners if things are taking a while to load)
Each page in the app needs a unique URL
All of that is achievable with Angular 1 - it'll probably be easier with a modern framework, but there's nothing stopping you sticking with what you've got, for now at least.
look at this github project https://github.com/addyosmani/angular1-dribbble-pwa

How to create local notification for ionic app?

I am using Ionic v1 and angularjs for my mobile app, I am storing some dates in localStorage. Based on this date and time user should get notification.
Can any one please suggest me how to proceed with it.
You can check the ngCordova local notification documentation here
ngCordova local notification

Best way to store data in a local Data Base in an application built using Angularjs and Electron

I am building an app using angularjs which is then ported to multiple platform using electron. The app needs a DB to store large set of data so which storage option is better. i want to use sqlite but will it work or correctly build in electron
You can store data in indexeddb. It is fast and completely html5 technologies.
Although indexeddb may be tough to understand for some users, so you can use any idb library which makes things easy for you.
Check out example of storing data using indexeddb library jsstore in electron - https://github.com/ujjwalguptaofficial/JsStore/tree/master/examples/electron
Yes you can use Sqlite with electron. Check out this answer which has further links and details.
https://stackoverflow.com/a/41230765/324143

Where to store Session Attributes with angular js

I am new to Angular JS, have experience on building spring web applications.
My requirement is to store the some session preferences (Not part of the user Model/entity) into session. I need to use them through out the application.
I couldn't find the right way to do it. I found some options, need suggestion on which one to use it.
ngStorage - can access Local/session storage and store attributes in it.
LocalStorageService - another githubproject, i can use it to store in session storage/ local storage.
Based on the articles i found, localstorage keeps the data even after logout, so have to make sure i clean all of them after logout.
What is the common practice to store session attributes?
I am planning to use ngStorage directive and use sessionstorage and store it by encoding with Base64. Is it a good way to do it?
I am using Java 1.7 and Angular JS for building an application. I have used JHipster to generate the application.
Any Help Appriciated!!!!
welcome! Well, depends the situation, localStorage is an excellent option to store attributes, but yes, it has some limitations and you have to remember to delete this. Another options is to use Cookies of angular project to store attributes on Client Side. I used in some projects and works perfectly for my use case. But if you are using Java, the best way is protect this session attributes using Java HttpServletSessions. I Hope it helps.
i had the same issue and i resolved by find the answer of this question: https://stackoverflow.com/a/922058/5995665
I hope it helps.

HTML5 mobile app with dynamic content

I'm creating a mobile app using HTML5 combined with PhoneGap. On every tutorial I watched, they only use static HTML content.
How could I do to load dynamic content (from a MySQL database on a my server), like news for instance ?
Can't I use PHP? Or do I have to use ajax calls to get the data and build the HTML via JS/jQuery ?
In this case, is it better to save the data? If so, is there an alternative to localStorage ? Isn't it simplier to save datas in a javascript object ?
Thank you for the answers
I usualy use ajax to get data from MySQL, i think dats an alternative, however u can use webSQL for IOS and Android and IndexedDB for WP if u wish to use phone localstorage. But i think WebSQL is deprecated so IndexedDB will b the best alternative for localstorage check this tutorial for indexedDB by Pual Kinlan:
TODO

Resources