cordova-sqlite-ext | PhoneGap plugin to open and use sqlite databases | iOS library
kandi X-RAY | cordova-sqlite-ext Summary
kandi X-RAY | cordova-sqlite-ext Summary
Native SQLite component with API based on HTML5/Web SQL (DRAFT) API for the following platforms:. LICENSE: MIT, with Apache 2.0 option for Android and Windows platforms (see LICENSE.md for details, including third-party components used by this plugin).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of cordova-sqlite-ext
cordova-sqlite-ext Key Features
cordova-sqlite-ext Examples and Code Snippets
Community Discussions
Trending Discussions on cordova-sqlite-ext
QUESTION
I have searched for houres but I couldn't really figure out wheter I can read a sqlite file on my sd card (phone's device storage) on android using the cordova-sqlite-ext plugin.
On https://www.npmjs.com/package/cordova-sqlite-storage it says that:
The following features are available in litehelpers / cordova-sqlite-ext: ... - Pre-populated database (Android/iOS/macOS/Windows)
So what I need is a sqlite database outside the webapp and a phonegap plugin that can read from this db. So, is it correct that the plugin above can do that???
Or is there any other way how to accomplish that task?
...ANSWER
Answered 2018-Jan-18 at 13:18cordova-sqlite-storage stores its database in the private storage directory of the app.
This is accessible only to your app and is located on the internal data partition.
For example, if your app package ID is foo.bar.com
and your database has name: store.db
then it will be located at /data/data/foo.bar.com/databases/store.db
.
The location data/data/foo.bar.com/
is referenced as cordova.file.applicationStorageDirectory
from cordova-plugin-file
.
You can use the cordova-sqlite-evcore-extbuild-free variant of cordova-sqlite-storage:
Custom Android database location (supports external storage directory)
The "external storage directory" is on the "SD card" which is usually the internal memory partition accessed via the mount points /sdcard/
or /storate/emulated/0/
.
Since Android 4.4, apps only have write access in the "application sandbox" directory on the SD card e.g. /sdcard/Android/data/foo.bar.com/
(cordova.file.externalApplicationStorageDirectory
).
All other areas of the SD card are read-only (e.g. the root of /sdcard/
- cordova.file.externalRootDirectory
) so while you could read from a database here, to write to it you'd need to copy it to either the private or external storage directory of the app. You could do this using cordova-plugin-file
, for example.
QUESTION
I am using cordova-sqlite-ext in ionic 3 project. My code is working fine when run without --prod
flag.
But when i run ionic cordova run android --prod --relase
it shows "can not read property of openDatabase"
here is my code
...ANSWER
Answered 2017-Sep-18 at 15:02When you do a production build the window
object is handled differently as far as I know. When using cordova-plugins which are not included in ionic-native you need to do things a bit different.
Tell typescript that you are sure your plugin handle exists somewhere after the build:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install cordova-sqlite-ext
As stated above: In case of Cordova CLI pre-7.0 it is recommended to add plugins including standard plugins such as cordova-plugin-whitelist with the --save flag to track these in config.xml (automatically saved in config.xml / package.json starting with Cordova CLI 7.0). In general there is no need to keep the Cordova platforms subdirectory tree in source code control (such as git). In case ALL plugins are tracked in config.xml or package.json (automatic starting with Cordova CLI 7.0, --save flag needed for Cordova CLI pre-7.0) then there is no need to keep the plugins subdirectory tree in source code control either.
It may be necessary to use cordova prepare in case of cordova-ios older than 4.3.0 (Cordova CLI 6.4.0) or cordova-osx.
In case of problems with building and running it is recommended to try again after cordova prepare.
If you cannot build for a platform after cordova prepare, you may have to remove the platform and add it again, such as:
https://github.com/litehelpers/cordova-sqlite-ext - latest version
cordova-sqlite-ext - stable npm package version
Use window.sqlitePlugin.echoTest and/or window.sqlitePlugin.selfTest as described above (please wait for the deviceready event).
Assuming your app has a recent template as used by the Cordova create script, add the following code to the onDeviceReady function, after app.receivedEvent('deviceready');:.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page