Android Tutorial Android SQLite Viewer

SQLite Viewer is an open source application that allows you to view the contents of SQLite databases right from your Android device.

sqliteviewer_1.png


sqliteviewer_2.png


Choosing the database file is done with an external file manager or with agraham's FileDialog.

After choosing a database file, you will see a list with the database tables. Choosing a table will open the second activity which shows the table fields types and the table contents.

BLOB columns will display: "click to see image".
When you click on such a cell the program will try to convert the BLOB data to an image and show it.

sqliteviewer_3.png


The code uses DBUtils code module for most of the SQL statements.
Handling the BLOB columns adds some complexity. You can see it handled in TableActivity code.
The source code is included in the zip file.
 

Attachments

  • SQLiteViewer.zip
    15.1 KB · Views: 2,962
Last edited:

Merlot2309

Active Member
Licensed User
Longtime User
Erel,

A very useful tool for SQLite databases.
Thank you.

Helen.
 
Last edited:
D

Deleted member 103

Guest
Hi Erel,

Many many thanks, have been waiting a long time. :sign0060:

:sign0098:
 

aklisiewicz

Active Member
Licensed User
Longtime User
While compiling this example I get following error
===============================================
Compiling code. Error
Error parsing program.
Error description: Unknown type: filedialog
Are you missing a library reference?
Occurred on line: 13
Dim FileDialog1 As FileDialog
===============================================
seems like I'm missing some library. Is there any way to download all available libraries and install all of the in one step, so I don't have to search for it every time I want to run some example app ? I think it should be a matter of good habit to include information with the example if any extra library is necessary to compile.

Thanks - Arthur
 
Last edited:

aklisiewicz

Active Member
Licensed User
Longtime User
no I did not get an error upon opening, but rather on compliling. I have found it and installed, mentioned library but I her the following error:

Compiling code. Error
Error parsing program.
Error description: Unknown type: contentchooser
Are you missing a library reference?
Occurred on line: 5
Dim cc As ContentChooser

I can't locate any library like ContentChooser

Arthur
 
Last edited:

Rusty

Well-Known Member
Licensed User
Longtime User
I too, had this problem. Where can I find the FileDialog1 library or code? I made no changes to the project included in the zip file. Thanks
 

kickaha

Well-Known Member
Licensed User
Longtime User
ContentChooser is part of the Phone library, ensure this is selected in the "libs" tab of the IDE.

The search function at the top of this page works guys:sign0060:
 

AscySoft

Active Member
Licensed User
Longtime User
Not working!? I know is me, but why? Here's the error:

Compiling code.
Error parsing program.
Error description: Unknown type: filedialog
Are you missing a library reference?
Occurred on line: 13
Dim FileDialog1 As FileDialog

Why is not working? In libs tab I've got all the 3 libs checked(core.phone,sql)
 

Harris

Expert
Licensed User
Longtime User
Weird..

I just tried the "apk" on my device (Flytouch 2).

It uses the filemanager and I can choose internal or external storage.
It opens the internal db with no problem, shows the contents of any table and images stored in blobs.

When I try to open the same db on the SD card, I get a toastmessage - "Error opening db" - and nothing shows.... The db is intact because my app uses it without any problems.

Thanks
 

oleman108

Member
Licensed User
Longtime User
The FileDialog is part of the Dialogs library and the ContentChooser is part of the Phone library.
I have the same problem like aklisiewicz and in addition I am not finding this Dialogs library. It does not show in the Libs Tab. How can I reference this library?
Thanks for :sign0085: to a newbie, Oliver
 

tamadon

Active Member
Licensed User
Longtime User
I created a sample database using SQLite manager Firefox addon. I can read the content fine when I have like 4 entries but when I have 10 entries I can no longer view the table list.

The table consists of 7 columns: ID, BLOP1, TEXT1, TEXT2, TEXT3, TEXT4, BLOP2. The database size is only 1120KB.

This problem only occur in the emulator, the emulator has 16MB SDcard. However I can view the tables using a real device.

What am I missing?

Thanks in advance for the help.
 

tamadon

Active Member
Licensed User
Longtime User
Attached is the sample database. SQLiteViewer can read that but when I add more record, the table is no longer readable.

I've increased the Max application heap size to 64 and the SD Card size to 1GB but those don't help either.

Any ideas?
 
Last edited:
Top