-3

I have written a code using DataBaseHelper class, i make a database using SQLite and place it in assets, then this helper class copies it into /data/data/mynamespace/databases, but if i insert values using SQLBrowser in SQLite db which is in assets folder, then i read it using code, but i dont find those inserted values, but if i insert it using code, i can see my values inserted, i understood it in such a way that assets and /data/data are two separate copies, but question is, how can i browse data using SQLite Database Browser from /data/data/mynamespace/databases/mydb file. Because that is the actual db, in assets there is just a copy, please let me know its solution.

Muhammad Atif Agha
  • 1,535
  • 3
  • 33
  • 74
  • people can just rate negative, but dont have answer for problem, may be i am wrong or asking wrong but let me correct if you know. – Muhammad Atif Agha Sep 06 '11 at 11:25
  • 2
    I think your question was rated negatively because it is not clear. Try to reword it in a way that would show the problem and the question, and just that. – Shlublu Sep 06 '11 at 11:30
  • Try posting some example lines of code where you copy the database and open it. – Moog Sep 07 '11 at 09:54
  • Suggest that you need to use more than 2 sentences in your 'question'. Perhaps in the future use a question mark somewhere. – p.campbell Sep 08 '11 at 01:58

2 Answers2

4

In this article he reads a SQLite file from the assets folder and copies it to ../../data/databases folder.

I am using this code and its' working fine for me.

Shadow The GPT Wizard
  • 66,030
  • 26
  • 140
  • 208
bhargavkumar040
  • 800
  • 7
  • 13
0

It sounds like your copy operation is either failing or going to the wrong place.

So when you try to access the database it is just being created instead of opened.

Moog
  • 10,193
  • 2
  • 40
  • 66