Difference between Ionic Storage and Native Storage? - ionic-framework

I'm Actually using Ionic Storage. and I heard About The Ionic Native Storage
I Don't Know the Exact Difference Between Them. Which One Is Preferred to use?

They have basically the same purpose and both work with key/value to store items, but i think Ionic Storage is better and i'll tell why.
The Native Storage need and will only work with the plugin instaled, so if there's no plugin or if it's a webapp the user can't use the storage. It's intended to be used because iOS may remove stored data when running out of memory.
The Ionic Storage works in a diferent way, you can save your values in the IndexedDB, wich is a type of storage for the browser, but if you install te SQLite plugin it'll automatically priorize to save your data in SQLite so there's no loss when iOS is out of memory.
So when using with SQLite, if in a browser running as a webapp the user can still save data, because since there's no plugin in the web it'll use the IndexedDB, and if there's no IndexedDB then it'll use localStorage.
And you don't need to learn SQLite to save with the plugin, the Ionic Storage will do all the work for you, you just need to use the key/value as the same way you would use for the Native Script or the localStorage.
Which one is preferred? It's all up to you, but i see more advantages in Ionic Storage.
Check out the Ionic Storage Docs.
Hope this helps.

the principal difference is this:
Native Storage is a Cordova Plugin, so only work in devices. Its a little faster than Ionic Storage on devices, because uses the native functions of the device to store Key/Value data.
Ionic Storage is a not a Cordova Plugin, is a javascript library, and can be used both in Devices and Navigators.
There are no big difference between them, i prefeer Ionic Storage because i can realize faster tests on browser during development.

Nowadays I work with ionic 4 and I have experienced unpleasant latency of the #ionic/storage module, but after I switched to the native storage I got a better performance. and by the way you still can use it while testing with the browser using the ionic cordova run browser command not the ionic serve command.
So what I am trying to say that native plugins always win in the matter of performance.
Best Wishes

Related

Is ionic storage preserved on ios when an updated version of an app is published

I have seen some posts that mention problems with ionic storage when publishing app updates. I'm using the #ionic/storage module in an ionic 5 app for ios to store some user customized app data. My question is will the user's data be preserved after they receive the app update?
I looked through the documentation but i couldn't find any information on this topic. Has anyone successfully updated an ios app and saw that the data managed by ionic storage was preserved after the update?
Here info from documentation of #ionic/storage for Ionic 3 (https://ionicframework.com/docs/v3/storage/):
When running in a native app context, Storage will prioritize using
SQLite, as it's one of the most stable and widely used file-based
databases, and avoids some of the pitfalls of things like localstorage
and IndexedDB, such as the OS deciding to clear out such data in low
disk-space situations.
The newest docs (https://github.com/ionic-team/ionic-storage):
Out of the box, Ionic Storage will use IndexedDB and localstorage
where available. To use SQLite for native storage, see the SQLite
Installation instructions.
So, to keep your data safe you should add SQLite to your application.

Is it possible to Flutter apps to write on iCloud/Google drive?

I am new to flutter and am trying to figure out if there is a way in flutter to write a file to iCloud (iOS) or google drive (Android). There seem to be APIs to do this in Swift/Android native dev, but I can't find anything in a flutter.
I essentially want my app to write on a text file in iCloud so that another install of the same app on a different phone by the same user can access that file. I'm trying to do this without my own cloud setup (no firebase etc, since it's so simple and small), so I thought iCloud/gDrive would be perfect.
The icloud_storage package does upload and download with iCloud.
The googleapis package provides rudimentary support for the Drive API. You'd want to use the google_sign_in for authentication as shown here.
I looked into it a while back but didn't continue due to how young it looked.
I've got no experience with iCloud so I can't really help you there, but I think you'd need to write your own platform plugin or use an HTTP API, if one exists.
I know that I'm late to the party but there is this module
https://pub.dev/packages/file_picker
I haven't used it myself but they seem to support iCloud

What is Intel xdk local storage size limit

I need to develop a mobile application that communicating with rest service. I think that using of intel xdk cross platform may be appopriate for that. I got some informations via internet investigation about the platform. Then i learnt that local db usage is possible by IndexedDb. But im confused with size limitation of persistent db file. So application may need to db file to use during offline bigger than 10mb. Is it a problem. By the way, offline db contains products with pictures. Im curious about that Is it possible to persist a field with only filepath referenced to mobile storage instead of byte of file? For example is it possible to save picture file which came from service to somewhere belonged to mobile's storage? Finally, can i deploy my program with initial db? Thx, brgds
There are many options for local storage for your app. It is important to understand that an XDK app is a Cordova app. The name XDK refers to the tool, not the runtime environment. Your XDK tool creates Cordova apps.
Try searching for something like "phonegap cordova local storage solutions" for a list of the options available to you when you create a Cordova app.
BTW -- PhoneGap apps are also Cordova apps. :)

How to use SFSmartStore for offline data storage in native iOS application?

I am working on salesforce application. In my application, i need to store data locally for offline supporting. For this, i have seen some forums to achieve offline data storing and retrieving using sales fore smart store setup. Can anybody give some guidance how to use smart store for offline supporting.
Thanks in advance.
To use smart store you need Salesforce Mobile SDk configured (for Android OR iOS)
after that please install the account editor example and study the code in here Account Editor Example secondly,
Using StoreCache For Offline Caching tutorial explains how smartstore works.

How to use native sqlite in ios' webview?

I just want to develop an ios app based on webview. The offline storage must be used. I know that html5 offline storage is supported by webview. But I just want to use a native sqlite file(not the one embedded in webkit) just like other native ios app. So could anyone please give me some clues?
Are you implementing the database via javascript? If so check out this great free eBook on building iPhone apps. The chapter about Client-Side Database should give you a running start.
http://ofps.oreilly.com/titles/9780596805784/ch05.html#ch05_id35933084
regards
Andrew
webSQL is available in UIWebViews.
However, if you're using Cordova the convention is to use the SQLite plugin. GIYF.
I personally like using web storage wrappers for this. Lawnchair.js and persistence.js were earlier wrapper solutions, but I like using Mozilla's localForage the most. It makes storing any kinda JS primitive/object/blob really easy.
localForage is just a wrapper over localStorage, webSQL, and SQLite. It has a really simple API and will choose the best web db for you based on what you wanted to store (was it serializable: localStorage. was it a [file Object] from an HTML input: webSQL). Your project can be a Cordova project or whatever. Don't matta. It'll work.