Android Tutorial Barebones View Examples with SQLite

I went through a (long) learning curve with regard to using SQLite, and creating Webview, Listview and Scrollview lists. There are a lot of great examples on this forum, but I found it difficult to come to grips with the essentials necessary.

So for my own sake I started to build examples of barebones programs that can put SQLite data in these lists.

This program still helps me today as basic building blocks for my programs.

I hope it will help someone else, somewhere along the line.

Johannes
 

Attachments

  • DataBase_Barebones_examples.zip
    47.8 KB · Views: 1,518

BPak

Active Member
Licensed User
Longtime User
Thanks for the examples Johannes. I needed example for the Web example.
:icon_clap:
 

Dman

Active Member
Licensed User
Longtime User
Thank you so, so much. As a newbie it s kind of hard to figure out some of these things with complex tutorials. Barebones is what we need sometimes. :)
 

grant1842

Active Member
Licensed User
Longtime User
Thanks for sharing :)
 

moster67

Expert
Licensed User
Longtime User
:sign0098: Very useful.

Thanks for sharing.
 

gillano

Member
Licensed User
Longtime User
bare bones

i like the bare bones examples

I would like to use the ListView2Col. so the other modules are not needed.

I would like to have the Data base generate with the values of Labels when a button is clicked

i'm having trouble understanding how to bring up the the ListView (I'll use a MenuItem)
 

stubuck

New Member
Licensed User
Longtime User
Simple is always good!!

Johannes, Thank you for taking the time to Keep It Simple!!! Your work is a TREMENDOUS help!
 

marcel

Active Member
Licensed User
Longtime User
Hi,

Thanks for this example. Just one question. Why have you declared in every activity a SQL1 var. I thought when you declare this once in the Main activity this would be enough and use Main.SQL1 to reference to this.

Is this wrong thinking of me?
 

jpvniekerk

Active Member
Licensed User
Longtime User
Marcel,

You are correct - it is not necessary. I dis this for my own purpose so that I can use each activity on its own as well - just copy and paste to a different app.
 

marcel

Active Member
Licensed User
Longtime User
Marcel,

You are correct - it is not necessary. I dis this for my own purpose so that I can use each activity on its own as well - just copy and paste to a different app.

Aha, ok thanks. This makes it clear
 

aklisiewicz

Active Member
Licensed User
Longtime User
I used you example App to build something on my own. It helps a lot, but I would like to go a little bit further and create an activity which displays record details. Got to the point when I'm a little bit confused.

I have a form with a query which reads single record bases on RecordID from the Listview. Then the next step is to assign a screen lavels (I call them strSting1, strString2,...) to display data in a queue (Array)

I'm not sure how would I pass the data from the query to the Array for a single record the to the screen ?

Example:
I have a set of screen variables which supposed to display data from the record like this:
B4X:
    Dim strID As Int
    Dim strIssueName As Label, strDesc As  Label, strSymptoms As Label, strBodyParts As Label, strBodySys As Label, strOrgans As Label
    Dim Query1 As String
then I have a line which reads the single record:
B4X:
Query1 = "SELECT * FROM issues WHERE ID =" & Main.IssueID
'?????

how would I read the record into Array, then to the screen ?
(in this case all strLavel1,... are read only)

Arthur
 
Last edited:

aklisiewicz

Active Member
Licensed User
Longtime User
I agree, this is one of the best database examples I could finsd, and I would just request more examples like that....
Thanks a lot!

Art
 

swamisantosh

Member
Licensed User
Longtime User
I went through a (long) learning curve with regard to using SQLite, and creating Webview, Listview and Scrollview lists. There are a lot of great examples on this forum, but I found it difficult to come to grips with the essentials necessary.

So for my own sake I started to build examples of barebones programs that can put SQLite data in these lists.

This program still helps me today as basic building blocks for my programs.

I hope it will help someone else, somewhere along the line.

Johannes
It is best Code, I'm new to b4a programming, It was really helpful to me
 

siddsg

Member
Licensed User
Longtime User
Hi Johannes,
I am getting an error "android.database.sqlite.SQLiteException: no such table: QueriesTable (code 1): , while compiling".
Would you know why?
Thanks,
Siddharth
 
Top