[Help]Using sqlite database in unity for android

I am making a quiz game for android in unity and the data(questions and answers) is stored in a sqlite database. The database is stored in StreamingAssets folder.

How can i update the database when I release an updated version of the game?

Currently I am copying the file to persistantDataPath from StreamingAssets to do read/write operations. Also the StreamingAssets folder is not updated when the app is updated.

I posted this question in stackoverflow also.

To use an SQLite database in Unity for Android, you can follow these steps:

Start by downloading the SQLite for Unity plugin from the Unity Asset Store or the SQLite Unity website. This plugin provides the necessary functionality to work with SQLite databases in Unity.
Open your Unity project and import the SQLite for Unity plugin by going to “Assets” → “Import Package” → “Custom Package.” Locate the downloaded plugin file and import it into your project.
Create a new C# script in Unity to handle the database operations. In this script, you can establish a connection to the SQLite database using the SQLiteConnection class provided by the plugin. Execute Database Queries: With the database connection established, you can execute SQL queries to perform operations like creating tables, inserting data, retrieving data, and updating data. Here’s an example of executing a simple query to create a table.
Once you have implemented the necessary database operations, you can build your Unity project for the Android platform. Go to “File” → “Build Settings,” select Android as the platform, and click on “Build and Run” to generate the APK file.
Remember to include the necessary permissions in your AndroidManifest.xml file to allow your Unity application to access the device’s file system and use the SQLite database. You can also try solving via https://www.devart.com/dac.html
By following these steps, you should be able to use an SQLite database within your Unity project for Android.

Privacy & Terms