Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Packaging SQLite DB with my application

I have created a SQLite database on my PC. I have imported it into my assets folder in the project directory. How do I access it from my Android application?

like image 400
Ragunath Jawahar Avatar asked Sep 08 '10 11:09

Ragunath Jawahar


People also ask

Can multiple applications use the same SQLite database?

SQLite can handle multiple applications reading the db at the same time, but not writing to it. From the SQLite FAQ: Multiple processes can have the same database open at the same time. Multiple processes can be doing a SELECT at the same time.

Can I use SQLite in web application?

SQLite is a database engine that is distributed with Python and supports most of the SQL standard. It is ideal for developing database backed applications and because it uses the same SQL as larger systems, it is generally easy to port applications to a production database like MySQL or Oracle for deployment.

How do I connect SQLite to a Windows application?

Open your Visual Studio and select new project and in Visual C# select "Windows Forms Application" and provide the name as Sqlite and click on OK. Right-click on your application and select "Open folder in your window application" and then go to: BIN -> Debug and extract your application here.

How do I add an application to SQLite?

Getting Started with SQLite from a .Open Visual Studio, select new project, and, in Visual C#, select “Console Application” and provide the name as SQLiteDemo. Click OK. To connect SQLite with C#, we need drivers. Install all required SQLite resources from the NuGet package, as pictured in Figure 1.


1 Answers

Copy it into your database directory (getDatabasePath()) using Java I/O. At that point, you can use it like a normal database. It is impossible to use it from within the assets themselves.

like image 168
CommonsWare Avatar answered Oct 03 '22 22:10

CommonsWare