Android-How can i attach SQLite database in python app - android

So i am writing a python3 app with kivy and i want to have some data stored in a database using sqlite.
The user needs to have access to that data from the first time he opens the app
Is there a way to possibly make it so that when i launch the app, the user that downloads it, will already have the data i stored, like distribute the database along with the app? so that i don't have to create it for every user.
I have searched here and there but haven't found an answer yet
Thank you in advance

Just include the database file in the apk, as you would any other file.

Related

reusing Room or SQLite database in the app?

I'm trying to figure out an android app that stores user's data in a database on sdcard.
But I don't know if it's possible to have these too:
even if the user deletes the app, the db remains and the user can access it.
So later they can re-install and give the app the path to the db file. The app uses that file as a database again.
Something like WhatsApp db, but the user must have the database as a file on their phone so they can transfer and store it anywhere. The data is large so it's not a good idea to get a backup file.
Is it possible to create it with Room or SQLite? and reuse it again?

Preserving SQLite db data on App Update/Reinstall Rollout Xamarin

I have Xamarin.Forms shared project that I am testing on Android phone currently.
The sqlite db is stored in System.Environment.SpecialFolder.Personal as of now.
I want to make sure that user input data stored in db is preserved:
1 upon each next upgrade I am planning for an app, as well as
2 In additional situation where user removes his app totally and makes a fresh install
(I guess these are two totally different situations, but I might be wrong)
I would like to know whether an update of an App via Google Play Store Update will overwrite db file too, therefore all data be lost? Or will the data be preserved?
What would be the option if a user wanted to preserve his/her data even after an app Uninstall/Reinstall?
In second case, I am considering manual/automatic backup of SpecialFolder.Personal db version in use and storing it as a separate file outside of the package using External_STORAGE permissions.
Then the user will be able to Import data from external db file copy into the one that comes in the package.
Also, how should the Import look like?
Can I simply replace the file with external one?
Any advice on this topic will be very appreciated.
An update from Google Play will not overwrite the db file
If a user uninstalls the application, he will want to delete everything related with the application. So my best solution is to have a synchronize method within your API so that, when the user installs again the application, it will fill the local DB with the requested data.

How to alert users on new update to local database?

I'd like to receive some advice from all of you.
What is the best way for me to alert users on an update to my app? My app is a very knowledge-based & it works like a dictionary, so there will always be updates to it.
The database I have used is by DB Browser for SQLite, and they are all local database where it is uploaded into the assets folder in Android Studio.
Currently, the limitations are that:
1) it's obviously not real-time because it's stored locally;
2) every update I make to the database structure, I am required to upload the new database into the assets folder again, followed by uninstalling the old app on my phone, then run the app to install in my phone again so that the new database is overwritten.
I have read (How can I regularly update a database of content on an Android app?) & some others, and it seemed like I have to have a server, a cloud-based database & live app in market, to solve the limitations?
Is there really no way for me to overcome the limitations if I want to stick to a local database? At the same time, I kinda wish to avoid setting up a server because I am not intending to make the app live on market, and also this is just a school project I am working on and as such, I have very limited skill sets & knowledge about it and would like to make it on a school-project-based level.
Thanks in advance.
One way to do it is to connect to your local DB through local network instead of assets folder. Therefore, you can update the information by querying the local DB.
As for syncing the information between DB and your application, you should create a trigger or watcher that notify your application when the DB is updated. Therefore, your application can know when to query the DB for the updates. Another way is to just query the database periodically.
Bonus: you could move your database to a cloud-based database. Usually there are several providers that provide free database hosting up to a certain size, which should be enough for your project.

How to access other apps data for a backup application?

I'm very new to android developing, and I'm making a project in my university for an app that backs up every other application's data to cloud. So in order to do this, I have to access it. Is it possible? And is there a way to do this without rooting the device?
The app that you want to create as backup use content provider in that app for insert,add, create, delete the data.That app work like a database for you.
For second app fetch the data from the first app.
use this link.
http://developer.android.com/guide/topics/providers/content-provider-creating.html

How to cout the number of SQLite databases in my app?

Is there a way of count the number of SQLite Databases in my app without the need of inform their names? I need to make the following thest:
If there is one or more Databases in the app, I want to direct the user to the login screen, if not, send him to a sync screen where he informs some personal data and the database is downloaded from my webservice.
Ps: The app is a remote version of a web based system, and unfortanatly it needs to have one database per user and it's name isn't the same for everyone.
After the answers I've decided to create a standard database saving the user ID and name, so if it's empty the app opens the login screen, if not it opens the sync screen.

Categories

Resources