Android App Development ~ Loading Existing DBs~

Asked 1 years ago, Updated 1 years ago, 91 views

I have a question about how to use DB for Android app development.

実現What I want to realize
Instead of creating a DB in the app, you can import an existing DB into the app and use it.

疑問Question
1, When I put the DB file in the associates folder referring to the following site (http://y-anz-m.blogspot.jp/2011/01/android-sqline-database.html, I got the following error:
Error saving an existing DB in the assets folder of the Project

I checked with SQLite and found that the character code is UTF-8, so I don't know what's wrong.

2, Is there any other way to use an existing DB (I looked for it and found no useful information on the website)?

発生Error Occurred
FiFile was loaded in the wrong encoding: 'UTF-8'

If you are familiar with Android app development, please reply.

android android-studio database

2022-09-30 19:31

2 Answers

The sqlite database file is not text, so you cannot view or edit the contents directly in the editor like the source code.


2022-09-30 19:31

Error Message: File was loaded in wrong encoding: 'UTF-8' and

The character code is UTF-8 as I checked with SQLite during the question. The character code used in the DB file in the assets folder is not UTF-8.

The file may have originated from an existing DB, but SQLite is not able to load it, so please review how to generate the file (export the character code as UTF-8), convert the character code, and so on.


2022-09-30 19:31

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.