ekjyot ekjyot -4 years ago 132
Android Question

Android:Sqlite tables

I have created tables in android sqlite using create statement and also inserted values into it.
Now I need to see these tables to look at the table structure. I don't know how to see them?
Can anyone tell me where is the .db file located in the project.And how to check these tables.

Following is my code for it:

String ctable= "Create Table offers_all(record_id TEXT,display_name TEXT,sorting_name TEXT,latitude NUMERIC,longitude NUMERIC,custom_ad_banner_resource_id TEXT,description TEXT,website_url TEXT,phone_number TEXT,hours TEXT,tasting_room TEXT,advertiser TEXT,street_address TEXT,offer_id TEXT,offer_section TEXT,start_date TIMESTAMP,end_date TIMESTAMP,custom_leaf_template TEXT,location_area TEXT)"

database.execSQL("DROP TABLE IF EXISTS "+ offers_all);

Insert into offers_all(record_id,display_name,sorting_name,latitude,longitude,custom_ad_banner_resource_id,description,website_url,phone_number,hours,advertiser,street_address,offer_id,offer_section,start_date,end_date,custom_leaf_template,location_area) values ( '23423-2134','Second Offer','second offer','-123.234234','32.42343','','Another Example of a Winery.','http=>//somewinery.com/','1.510.555.1212','10:45 am - 2:30pm','Yes','500 Yajome Street,11-10 10:44:10.599: Calistoga, CA, 94333','','','2011-08-24','9999-12-31','','Sonoma Valley')

Answer Source

Your android application's database file is stored in /data/data/<package_name>/database directory.

You can access it by ddms file explorer or via adb shell, pull from device then you can see it in SQLite Manager or Eclipse SQlite plugins.

Also you can write query in adb shell for check existing data in your database.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download