I have just started learning cordova. I want to know how to save something in Internal Storage. Which plugin and code should I use? Please help me. And if you have a demo project, please give it?
How can I save a file in internal storage from cordova app?
1.2k views Asked by AJDM Jakiur Rahmanl At
2
There are 2 answers
0
eb1
On
Not sure what's meant by internal storage -- I'm guessing something permanently on the device?
Cordova is not very prescriptive in where you should store your data, and that's kind of on purpose (if you listen to some of the videos, its original goal was to not be needed, once web apps became functional enough). That said, there's an article on the Cordova site that describes pros and cons of the various places you can store things with Cordova / javascript / plugins: https://cordova.apache.org/docs/en/10.x/cordova/storage/storage.html
On my app (https://github.com/adapt-it/adapt-it-mobile if you're interested in poking around), I use a combination of places to store things:
- LocalStorage for user preferences; small bits of data that are less of a big deal if they're removed (iOS stores LocalStorage items in an area that could potentially be cleaned out)
- SQLite (database) storage for the real stuff.
- File export is done using cordova-plugin-file, as Akshaya mentions. I then use the social sharing plugin to present export options to the user (email, text messaging, etc.)
Related Questions in CORDOVA
- how to get rid of the cordova screen when you open the app
- How to build a codesandbox project to android apk?
- Cordova Android run failed
- Cordova Build issue since version 12.0.0
- cordova-background-geolocation-plugin don't giving any response in cordova android app
- provider duplicate while compiling a Cordova application for the Android platform
- Detect clickable areas within <img> tag in Ionic project
- Whitelisting Ionic app in Salesforce Org for CORS/CSP
- gradle keeps failing. Cordova run. Vscode
- Cordova plugin splashscreen issue while Azure Devops with ant build using android-cordova application
- Ionic 3 issue while generating AAB file
- Xcode Undefined symbols, Linker command failed with exit code 1 (use -v to see invocation)
- Xcode 15.3 build failed
- Samsung screen zoom ruining my cordova built android app
- command: ionic server Killed 9
Related Questions in CORDOVA-PLUGINS
- cordova-background-geolocation-plugin don't giving any response in cordova android app
- Failed imports in ionic plugin
- android.content.ActivityNotFoundException: No Activity found to handle null
- httpd plugin in ionic capacitorJS
- Connecting Custom Cordova Plugin in Native vue app
- processReleaseMainManifest FAILED when build in cordova 12.0.0
- After installing cordova-plugin-screen-orientation npx cap sync does not work anymore
- download PDF file from external website with inappbrowser ionic cordova
- From @awesome-cordova-plugins/in-app-browser not able to download PDF in Ionic Cordova Applications
- Using NFC scanning functionality in React apps with Capacitor
- How to disable log output in Cordova apps
- cordova my height body got shrink after keyboard pop up
- Unable to do payment in angular cordova app from android device
- SAPUI5 Bundled app w/ Cordova SSO SAP Backend
- TypeError: Spread syntac requires ...iterable[Symbol.iterator] to be a function
Related Questions in CORDOVA-3
- unable to build the cordova android apk through gitlab cicd pipeline
- Getting Error: Failed to load resource: net::ERR_CONNECTION_REFUSED when using my Cordova File Picker App
- Cordova GLOBAL is not defined when running on Android
- Facing Internet Connectivity Issues in Latest Version of Cordova Android - Cordova Android 11.0.0
- Ionic WebServer Android Static File Path Error
- How can I save a file in internal storage from cordova app?
- how to install ionic cordova local notification extension?
- Which cordova plugins are causing my app rejection in Apple store
- Error while installing mobileui npm install -g mobileui
- Build failed with CMD line --ionic cordova build android
- How can i fix this error message saying "failed to install 'cordova-plugin-firebase'" when i try to create an android app through cordova?
- Cordova Issue "Execution failed for task ':app:mergeDebugResources'."
- JDK version error when building android app cordova
- Make Ionic Native Camera Plugin only take pictures from FRONT camera
- On ionic cordova file.copyFile error = FileError { code: 5, message: "ENCODING_ERR" }
Related Questions in NGCORDOVA
- An error occurred while executing subprocess cordova
- How can I save a file in internal storage from cordova app?
- Which cordova plugins are causing my app rejection in Apple store
- Cordova angular app (reverse) proxy configuration
- Problem in closing menu in ionic when I test in device
- Error: [$compile:tpload] when running in debug mode in android devices
- "cordova run ios " in Windows not works
- Visual Studio(2017) Tools for Apache Cordova has an error after upgrading to XCode 9
- Calendar-PhoneGap-Plugin creates event and then it is deleted
- Cordova angular app on hardware back button press, open last opened view
- Check if Mobile Device has Automatic Time Zone enabled using ngCordova
- can we modify cordova plugins(cordova-plugin-fcm) and use in our project?
- Create print menu using ionic 2/3
- Getting id_token from Microsoft OAuth2.0
- ionic cordova statusbar for ionic v1 not working
Related Questions in CORDOVA-2.0.0
- Floating window Cordova
- jQuery windows mobile app "append(html) not working"
- Display progress bar using jquery in phonegap android for multiple files upload / download
- WARNING: Slow defaults access for key Internal took xx seconds, tolerance is 0.020000
- NSInvalidArgumentException', reason: '[__NSCFString JSONObject]' with PhoneGap Camera
- How to fix Sqlitelog (13) statement aborts at 68 error in phonegap android
- how to get id of selected list data in the jquery mobile autocomplete
- jquery timepicker not working in phonegap android
- How to set limit to jQuery mobile autocomplete to display on 10 results
- Jquerymobile-1.4.0 keyUp event is called twice every time character is entered in the autocomplete textfield
- Phonegap - Error - Keystore alias not recognized
- Cordova 2.2.0.jar doesn't work on Android 4.2.2
- Play MP3 using Media with phonegap/Cordova
- header and footer changes their position when keyboard popup in phone gap android
- JQM multiselect list option Set value selected from database
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
You need to use cordova-file-plugin. This plugin can be used to access, read and write file. Check here - https://cordova.apache.org/docs/en/10.x/reference/cordova-plugin-file/index.html
You can also find sample examples for Create Files and Directories, Write, Read, and Append files