where SQlite DB getting stored Path?


Last Updated:

  1. ajitandroid26

    ajitandroid26 Member This Topic's Starter

    Joined:
    Aug 25, 2010
    Messages:
    9
    Likes Received:
    0
    Hi All,

    I am new to android.I am trying to create a Database using SQlite.
    Its working fine.I am able to create table, insert data, and delete table.
    But actually where in my system the .db file is getting stored.
    If i call the getPath() method then its giving me the path as
    "/data/data/my package name/databases/database_Name"
    But where exactly it is stored?

    Please help me!!!


    Thanks & Regards,
    Ajit
     

    Advertisement
  2. meskiukas

    meskiukas Member

    Joined:
    Aug 20, 2010
    Messages:
    13
    Likes Received:
    1
    ajitandroid26 likes this.
  3. ajitandroid26

    ajitandroid26 Member This Topic's Starter

    Joined:
    Aug 25, 2010
    Messages:
    9
    Likes Received:
    0
    Hi meskiukas,

    Thanks for your reply!

    But I am unable to find out that folder in my system.
    Even I have search my entire system and still not found.
    Where is /data/data/<package_name>/databases folder present in the system? I want to navigate to that folder and want to see the .db file created by the application.

    Please help me...

    Thanks & Regards,
    Ajit
     
  4. IanGClifton

    IanGClifton Well-Known Member

    Joined:
    Feb 7, 2010
    Messages:
    111
    Likes Received:
    19
    That's the absolute path on the device. Use you "adb shell" to access the device and then "cd /data/data/<package_name>/databases" to get to that folder. Use the "ls" command to list the files there and "sqlite3" (plus the database name) to access it. You might want to try this on the emulator before the actual device because there are usually no extra snags to run into.
     
    ajitandroid26 likes this.
  5. ajitandroid26

    ajitandroid26 Member This Topic's Starter

    Joined:
    Aug 25, 2010
    Messages:
    9
    Likes Received:
    0
    Thanks for your reply!

    Yes, I am trying to see the .db file in emulator.Is it possible?
    If possible then how?Please help me...

    Thanks &Regards,
    Ajit
     
  6. jonbonazza

    jonbonazza Well-Known Member

    Joined:
    Jul 13, 2010
    Messages:
    1,934
    Likes Received:
    458
    The /data/ folder and all its subdirectories are only accessible by a rooted phone (Well... that isn't entirely true, but for the sake of simplicity we will stick with it).

    In order to view its contents, you must use the adb shell to gain temporary root access and, like stated above, list the files using 'ls' and read the datbase using 'SQLite3'.

    The link that was posted earlier in the thread (a couple times actually) will explain everything you need to know.
     

Share This Page

Loading...