5

I have a .sql file with insert statements in C:\sqldata\MyData.sql. I need to insert data into sqlite database in my Android App using this .sql file.

How could I do this?

Bishan
  • 15,211
  • 52
  • 164
  • 258
  • use file Connection API, open .sql file, read insert statements and insert data into database :) – Lucifer Nov 20 '12 at 05:37
  • You can do it using a process called ETL. See here: http://stackoverflow.com/questions/4555261/convert-sql-to-sqlite-in-an-easy-way – Anup Cowkur Nov 20 '12 at 05:37
  • At fist you need it to put into the directory res/raw. The other stuff you will find easyly – rekire Nov 20 '12 at 05:40
  • http://stackoverflow.com/questions/9109438/how-to-use-an-existing-database-with-an-android-application/9109728#9109728 – Yaqub Ahmad Nov 20 '12 at 12:58
  • I have found answer for my question from [here](http://www.michenux.net/android-database-sqlite-creation-upgrade-245.html). – Bishan Nov 20 '12 at 07:15
  • Is this an Android app for your own personal use or one which you plan to distribute? – Code-Apprentice Jan 16 '17 at 02:06

1 Answers1

0

First of all download sqlite browser or equivalent software and execute your create-insert statements. then follow that tutorial(which is an awesome tutorial)

Ercan
  • 3,705
  • 1
  • 22
  • 37
  • 1
    http://stackoverflow.com/questions/9109438/how-to-use-an-existing-database-with-an-android-application/9109728#9109728 – Yaqub Ahmad Nov 20 '12 at 12:59