C
C
CloudMonster2014-04-20 13:44:41
Java
CloudMonster, 2014-04-20 13:44:41

How to import a ready-made database into Android?

Hello!
Just started learning how to develop android app.
There is a ready database in one file.
How to import it into Android?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-04-20
@CloudMonster

openDatabase

V
Vladimir Yakushev, 2014-04-23
@VYakushev

I can offer my piece of code: dbLibraryHelper.java . Line 69 in my case either opens an existing database or creates a new one. In your case, there is one subtlety: in order to use a ready-made base, you need to put it on a memory card in advance. getAssetString () has a copy of assets to a string. In your case, you need to write assets to a file. See loadContentFromURL() for how to do this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question