#Region Project Attributes
#MainFormWidth: 600
#MainFormHeight: 600
#End Region
#AdditionalJar: sqlite-jdbc-3.7.2
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private xui As XUI
Private Button1 As B4XView
Private TableView1 As TableView
Private Label1 As Label
Private sql As SQL
Private counter As Int
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.RootPane.LoadLayout("Layout1")
MainForm.Show
sql.InitializeSQLite(File.DirApp, "chinook.db", True)
End Sub
Sub Button1_Click
counter = counter + 1
DBUtils.ExecuteTableView(sql, "SELECT artists.Name, albums.Title, tracks.Name FROM artists, albums, tracks WHERE albums.ArtistId = artists.ArtistId AND tracks.AlbumId = albums.AlbumId" , Null, 0, TableView1)
Label1.Text = "Refreshed " & counter & " times."
End Sub