0

I'm new to Android. I have already text file of all city and there location database file in MySQL dump. I wanted to connect these file to my database. How can I do?

manlio
  • 18,345
  • 14
  • 76
  • 126
  • maybe [this link](http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/) could help you – cosmincalistru Jul 25 '12 at 10:02
  • Find the code explained here in detail for this same purpose. http://stackoverflow.com/questions/9109438/using-already-created-database-with-android/9109728#9109728 – Yaqub Ahmad Jul 25 '12 at 11:07

2 Answers2

0

If you want to add an existing database file to the application, you can refer following link:

http://zaman91.wordpress.com/2010/09/22/android-how-to-use-own-sqlite-database/

Let me explain how it goes, this code checks if database file already have been copied or not, if not it opens an stream from the database file in assets folder and write this file into internal storage of application memory. and then create an database object from it.

jeet
  • 29,001
  • 6
  • 52
  • 53
0

create folder calledassests in your Android Project and keep your txt files there.

you can use these files in your project. check this for Android: Loading files from the Assets and Raw folders

Ram kiran Pachigolla
  • 20,897
  • 15
  • 57
  • 78