how to share a flutter app with integrated sql db - sqlite

i made a flutter app which creates then uses an sqlite db.
To share my app, i used to upload the apk file in google drive, but everytime it is downloaded then installed on a phone, the db is empty.
I want to share the app with the db filled, but i don't know how to do this.
Any help please ?

When your users run app at first time, their database is empty. Your problem can be solved by two ways:
Create entities in database (data that you sharing) at database initialization.
Create a backup feature that provides possibility to import database from the user's storage (just replace db file in app's internal folder by db file from external storage (Downloads folder for example)).

Related

Why does my deployment have no data but my preview has all the data?

My preview works and has data but my deployment has no data. I'm using the (Recommended) DEFAULT CLOUD SQL database configuration.
Note: This is only day 4 with Google App Maker. Finding answers to App Maker-specific questions has been super difficult, but I'm making rapid progress on my application, so overall tired but good. :{)
As written in the documentation,
App Maker deployments can use the same Cloud SQL instance, but have separate databases on that instance. Data that you had in preview mode is not available in other deployments. You have a few options for how to handle this situation:
To use data from the preview instance in your published deployment, export the deployment data from the preview instance and import it to the published deployment.
To share a database across all deployments (preview and published), use a custom Cloud SQL database.
When you deploy your app, AppMaker create a new database in your google cloud SQL instance for the deployment. All the data create in previews is in another database.
To use the same database as the preview mode you have to go in the settings of your app in the tab "DATABASE" and copy the Database Key. Then go to your cloud sql instance in google cloud platforme and on the details of the instance in the overview tab just copy the instance connexion name.
then edit your deployments and select "Use Custom Cloud SQL database" and copy with the format
"instanceConnexionName/DatabaseKey" then save and appmaker should ask you to enter you username and password of your google cloud sql insatnce.
On app settings, database page you should see
Databas key: iTIJQaCj491a4111
(Actually this is the name of the mySQL instance)
In GCP console, go to SQL, click on Instance ID, and on the Instance ID overview page is the instance connection name, e.g., MyProject-123456:us-central1:instancename
Back in app settings
Select Switch to custom database and enter the full connection string
projectname:instancename/schema as
MyProject-123456:us-central1:instancename/iTIJQaCj491a4111
Provide username and password
and follow the steps to confirm existing database
Turns out the issue is when you publish it doesn't push the data, you have to manually re-upload the data into the live version. This is actually a good thing, but I wish it'd been explicitly documented. I found it, after figuring it out on my own, in some early release notes from a few years back. I guess I wasn't the only one this stupid.

In Ionic or cordova platform, how to sync and retrieve database from iCloud

I have build an app using ionic framework, and the data uses sqlite database and stores in app /documents folder.
Now I want to know is it possible to sync the database into iCloud, so the user can retrieve the data automatically if they reinstall the app or use a new device.
I did search for some solution, some suggest sync to remote database using such as pouchDB or parse. But as for our company policy, we cannot store app data into any other remote place exclude iCloud.
Any ideas? Thank you so much.
As far as I know, iCloud automatically backs up data on the user's local storage. You don't need to do anything extra.
I might be wrong, but soome people seem to have problems with it doing that
Check out this page
Relevant:
BackupWebStorage(string)
Default: cloud
Allowed values: none, local, cloud.
Set to cloud to allow web storage data to backup via iCloud. Set to local to allow only local backups via iTunes sync. Set to none prevent web storage backups.

Large prepopulated SQLite database with Appcelerator Mobile

Just getting into mobile app development, and I have a couple of very basic questions relating to the use of a large prepopulated SQLite database. It's not a typical for-public-consumption app that captures a little bit of user data.
The app would be deployed to some employees of the company, not to the general public. We would like to attach their phones via USB cable to a PC and copy a 300MB SQLite db file onto their phones.
We would like to write a number of apps that know how/where to find that db file in the phone's file system, and issue selects against it. It would be read-only.
Is that scenario feasible with Appcelerator? Can the database file be located outside the folder structure of the app so that multiple apps could use it?
On both iOS and Android apps are sandboxed and can only access their own data. On Android you could use the external storage but then every app would be able to access it. Also, since on iOS the app won't be able to open the SQLite database from the read-only application resources, it will be copied to the application data directory, meaning the app will be 300+300MB in size. You better download the files once the app is installed.

Open SQLite database on Google App Engine

Is there anyway to open and read a SQLite database file on GAE?
I am currently uploading dbs to blobstore as admin and serving them publicly to user clients. I just can't read them in the GAE admin interface.
You can use SQLITE on Google App Engine. The problem has nothing to do with the support of certain libraries. It has to do with read-only file system. There is, however, a writable /tmp directory. If your app on startup first copies the db.sqlite3 file to /tmp/db.sqlite3 and references this path as database path, it will work.
There are, however, drawbacks.
1. This is not a "real" directory i.e. it's stored im memory. If database is too large, one will get problems.
2. Each instance has its own copy of db.sqlite3 file. Does not scale well.
Here is a django example:
Using SQLITE for local Django development for Google App Engine?
Short answer, no it is not possible to use a SQLite database on a standard Google App Engine application as it is not currently supported. However, you can give a try at implementing your own configuration with the App Engine Flexible Environment that allows to take advantage of custom libraries through Infrastructure Customization.
In case you would want to experiment, here is a sample Django application designed to be run with its default SQLite database on the App Engine Flexible Environment. Still, make sure to read the database notice providing alternative data storage options and explaining that SQLite data does not persist upon instance restart.

How to update sqlite db file after deployment the app in windows phone store

I have deployed the 1st version of my wp8 in wp store and now i want to deploy the update version of it. Though I know the process of update deployment, but my concern is the sqlite file which doesn't get updated.
Here is the scenario, I have sqlite file in the app where user can store config and setting, in new version I added extra tables and I want to these tables should be reflected in the the update without affecting user settings and config.
What points I should consider to take care of this issue?
Thanks!
Assuming the data in the sqlite database is static you can give the database a new name and submit it with the updated app. One first run copy the new database to isolated storage and delete the old version of the database to save space.
If the user is inputting data into the database you will have to include code to modify the database structure on the first run and insert any records into the new table

Resources