i have bought your db and i am trying to run a small program and trying to retrieve records from a mysql table. but the app is closing down. unfortunately app has stopped.
I am using basic4android 2.47
#Region Project Attributes
#ApplicationLabel:MS MYSQL
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim db As MySQL
Dim lstvw As ListView
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
'lstvw.Initialize("lstvw")
'Activity.AddView(lstvw, 0 , 0, 40%x, 100%y)
DisableStrictMode
'Event Database Host Username Password Databasename
'db.Initialize("sql","host.com","dbuser","dbpassword","database")
db.Initialize("MySQL","192.168.1.103","root","SUBSOUSWA2000","suncity")
End Sub
Sub Activity_Resume
Log("Activity_Resume()")
'db.ListTablesAsync
'db.queryasync("select * from ufo_trainer LIMIT 0,1 ;")
db.QueryASync("select * from saleitem ","saleitem")
' Dim batch As List
' batch.Initialize
' For i=1 To 100
' batch.Add("INSERT INTO b4alog SET log_value='Test"&i&"', log_time="&DateTime.Now&";")
' Next
' 'db.ExecuteBatchASync(batch)
' db.ExecuteASync("INSERT INTO b4alog SET log_value='only one query', log_time="&DateTime.Now&";")
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub MySQL_ExecResult(meta As Map)
Log(meta)
End Sub
Sub MySQL_BatchResult(batch As Map)
Log(batch)
End Sub
Sub MySQL_QueryResult(data As List, meta As Map)
'Dim m As Map = meta
Msgbox("MySQL_QueryResult("&meta&")", "")
For i=0 To data.Size-1
Dim cur As Map
ToastMessageShow(cur.Get("TRAN0") , "")
ToastMessageShow(cur.Get("LOCCODE") , "")
Next
End Sub
Sub MySQL_ListTables(tables As List, ms As Long)
Log("MySQL_ListTables("&ms&"ms)")
For i=0 To tables.Size-1
Msgbox("Table "&tables.Get(i), "")
Next
End Sub
Sub DisableStrictMode
Dim jo As JavaObject
jo.InitializeStatic("android.os.Build.VERSION")
Msgbox(jo.GetField("SDK_INT"), "")
If jo.GetField("SDK_INT") > 9 Then
Dim policy As JavaObject
policy = policy.InitializeNewInstance("android.os.StrictMode.ThreadPolicy.Builder", Null)
policy = policy.RunMethodJO("permitAll", Null).RunMethodJO("build", Null)
Dim sm As JavaObject
sm.InitializeStatic("android.os.StrictMode").RunMethod("setThreadPolicy", Array As Object(policy))
End If
End Sub
Please help