Need to store a file/pdf in SQLite in Ionic 4 - sqlite

I’m new to ionic and in my Ionic Application, I need to store a pdf and image file in SQLite i.e in the app storage and should open within app. I will get the file from another database like MongoDB in the URL format. Could anyone of you help me out of this and suggest any references to complete the app storage using SQLite.
Thanks in advance.
I have researched on different aspects but could not find any.

Related

Importing a database using sqlite, flutter app

My main goal is to import a database into a flutter app using sqlite(sqlflite plugin), instead of having to hard code all of the create tables into the apps code.
*I want the information to be accessed to the phone locally(access data from phone on airplane mode) that is why i am using sqlite
I am having trouble finding information on this online and was seeing if anyone had experience in doing this or has documentation/examples that could help.
i think you are looking for this :
Open an asset database in this case you must have the database already and you don't need to create tables
Flutter supports an open source module SQFlite. SQFlite is a way of storing app data in Flutter Application. SQFlite is a Database plugin for flutter. It is highly reliable and embedded Database engine. All the CRUD operation in the database will run on a background thread. You can see a simple example of this here.

how to read data from sqlite database in phonegap?

i use phonegap for my application. i create sqlite database and copied it on memory card.
Is it possible to read data from the database on a memory card
thank you and sorry for my poor english.
No. You can't read the database from a custom path. The PhoneGap/Cordova expects the database to be in particular location. If not present, it will create a new database.
But you can move the content to the expected location and start working on it.
Some links to help are:
http://www.raymondcamden.com/2012/7/27/Guest-Blog-Post-Shipping-a-populated-SQLite-DB-with-PhoneGap
http://gauravstomar.blogspot.in/2011/08/prepopulate-sqlite-in-phonegap.html

Where the sQLite database file created ,stored in jQuery Mobile Application

In my jQuery Mobile App i have created sQlite Database and all transactions work successfully , and I want to see the DB file, I searched for it in my project directory but I didn't found it? Does phonegap create file for the created sqlite DB? and where is it? how I can pull the DB file in order to see the inserted data?
I have searched over the internet but I didn't found any answer ,please help me .. since I am new in jQuery Mobile.
Thanks in advance.
Most likely your database is being created in android's cache directory. The following stackoverflow followup answer by the original questioner and it's backlink to an earlier answer should be all you need:
Using PhoneGap for Android : Not able to create table in the database

How do I use an existing sqlite database in my Windows Phone 8 app

I have a database from an existing android app that I need to import into my Windows Phone 8 app. Is the only way to do this to create some huge population script to be ran on the first loading of the app?
I am currently using the new sqlite-net-wp8 by Peter Huene as directed by this blog post. But the examples are all about creating the database, not using an existing one. Any help would be great.
This link shows how to copy an existing sqlite database in Windows 8. The ability to do it on a phone is the same.
1) Add the sqlite database into your project and set the type to content in its properties.
2) When your app loads, load the file into a storage file. Then write it back out using the localfolder as the destination.
WP8 only supports local (in local file) databases.
Check your solution and search for database file. If file does't exist then You can only copy by script.

Reading a local sqlite file from phonegap

I can create a sqlite DB in phonegap/html5 via window.openDatabase. I am going to have a large amount of data, so I want to ship it with the app.
So can I store a sqlite DB somewhere, within the app (It needs to work on both iOS and Android). I particular where is the shortName.db stored when I call
var db = openDatabase(shortName, version, displayName, maxSize);
And can I pre-populate this sqlite file. (In the phonegap environment)
Listed here are some solutions for iphone and android:
http://groups.google.com/group/phonegap/browse_thread/thread/5e57a728dc66a2a1?pli=1
I've not used PhoneGap, only created HTML5 apps that use Web SQL. However, if you're asking whether you can ship an app with a pre-populated SQLite database, then yes you can. Probably the simplest approach would be to provide the table creation scripts as part of the app. When it's first fired up, you can have the scripts run, and your database will then be fully initialised.
An alternative approach for deploying bulk data I came up is simply serialize it into text files and deploy the files together with the app.
You can use the File API provided by PhoneGap to load these files as strings, and parse them with Ext.util.JSON.decode().
Finally, use the MemoryProxy to integrate the decoded data with the rest of Sencha Touch and you are golden.

Resources