Android Tutorial SQLiteDB

Below you find an application with a SQLite database and a ScrollView based table.
What the program can do:
- Read a database, 'Load' button.
- Edit, modify or delete date sets (single- or multi-selection), 'Edit' button.
- Edit and modify a single cell, 'Long_Click' on a cell in a selected row.
- Filter the database, 'Filter' button, Click filter or unfilter, LongClick definition of filter criterias.
- Sort a column ascending or descending, clickink onto the column header.
- Create a new database, 'New' button.
- Scroll the table verticaly with the standard Scrollview, and horizontaly on the blue line between the ScrollView and the toolbox (or with a SeekBar, hidden by default.
- Change the table setup, alignment, column width, text size, colors, etc.

What the program connot do:
- Share multiple tables.

I post it as a tutorial more to show what could be done, rather than a specific program in Share Your Creations.
Questions, constructive critics, comments, wishes and bug reports are welcome.

You can use the source code, or parts of it, for your own applications.

EDIT: 2012.07.05
Added a version using the ScrollView2D library.

EDIT: 2013.02.08
Amended error reported in post #27
Updated zip file SQLiteDB_2D_v_1_2.zip

EDIT: 2013.02.09
Amended error reported in post #30
Updated zip file SQLiteDB_2D_v_1_3.zip

EDIT: 2013.04.19
Eliminated error with Null values in a database reported in post #45.
Updated zip file SQLiteDB_2D_v_1_4.zip

EDIT: 2013.07.01
Eliminated some errors.
Removed most of the compiler warnings.

EDIT: 2014.02.09
Amended bug reported in post #57
Missing DBFilePath on btnLoad_Click

Best regards.
 

Attachments

  • SQLiteDB1.jpg
    SQLiteDB1.jpg
    48 KB · Views: 14,087
  • SQLiteDB2.jpg
    SQLiteDB2.jpg
    50.7 KB · Views: 2,688
  • SQLiteDB3.jpg
    SQLiteDB3.jpg
    34.4 KB · Views: 20,168
  • SQLiteDB4.jpg
    SQLiteDB4.jpg
    41.4 KB · Views: 2,432
  • SQLiteDB5.jpg
    SQLiteDB5.jpg
    27.4 KB · Views: 2,664
  • SQLiteDB6.jpg
    SQLiteDB6.jpg
    49.7 KB · Views: 9,197
  • SQLiteDB7.jpg
    SQLiteDB7.jpg
    49.4 KB · Views: 2,656
  • SQLiteDB_V1_1.zip
    26.2 KB · Views: 4,066
  • SQLiteDB_2D_V1_5.zip
    28.5 KB · Views: 3,491
Last edited:

Beja

Expert
Licensed User
Longtime User
Hi Klaus,
kind of weird.. the error is only when I use the emulator.. but on real device it is running fine, no problem.
 

Beja

Expert
Licensed User
Longtime User
The storage page items are grayed out and I had no chance to edit them. (image)
 

Attachments

  • emulator.jpg
    emulator.jpg
    59.5 KB · Views: 419

Beja

Expert
Licensed User
Longtime User
Then will re-install it again... danke!

another minor issue,
in the horizontal scroll, one can easily lose his record.. is it possible that the alternating color be for the rows instead of the columns?
 

Beja

Expert
Licensed User
Longtime User
looking into the cel-col part of the code.. hopefully will get it..

many thanks.
 

IslamQabel

Active Member
Licensed User
Longtime User
Dear Kalus.....your program is so great and wonderful....Actually, i want to record GPS real time data (long & lat & speed) in table...i succeeded to record these data on a txt file ....which part of the program could be useful for storing my data? ....As your program is so large so i can not get the useful part for me
Thanks
 

cncncn

Member
Licensed User
Longtime User
Hi,

Thank you for this work.
But when i load my file.db i have got this message :

Error occurred


An error has occurred in sub:main_loaddatabase(java line: 2595)
android.database.CursorIndexOutOfBoundsException: Index 0
request, with a size of 0
Continue ?
 

klaus

Expert
Licensed User
Longtime User
Can you test the program in Debug mode and post the message in the Log.
Or post your project with the database as a zip file (IDE menu Files / Export As Zip).
Is your database a SQLite database ?
SQLiteDB works only with SQLite databases !
 
Last edited:

cncncn

Member
Licensed User
Longtime User
Can you test the program in Debug mode and post the message in the Log.
Or post your project with the database as a zip file (IDE menu Files / Export As Zip).
Is your database a SQLite database ?
SQLiteDB works only with SQLite databases !
ah ok. It isn't SQLite databases but Paradox databases (.db)
 
Top