Android Question Application stop working

microbox

Active Member
Licensed User
Longtime User
Hi everyone!
I have an application that was running for over a year then suddenly stops working. I hope someone can give an idea what may be the problem is.
Android 4.1.2
device odroid from hard kernel
Error message
B4X:
An error has occured in sub:main_activity_create(javaj line: 581)
java.lang.RuntimeException:Cannot parse: errr as bo

This the code in Activity.create
B4X:
Sub Activity_Create(firstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    If firstTime Then
      
        SQL.Initialize(File.DirInternal , "lmwd_db1.db", True)
        'Activity.AddMenuItem("Close Application", "mnuCloseApp")
    End If
   
     Activity.LoadLayout("Layout1")   
    '--------------Timers----------------------------------------
    TmrInit.Initialize("TmrInit",70)
    TmrDisableprinter.Initialize("TmrDisablePrinter",4)
    TmrDisableprinter.Enabled = False

   
    TmrInit.Enabled =True
    flagExpress = False
    MainBtnSelected = False
    '-----------------------------------------------------
   
    'DBUtils.DropTable(SQL, "Queno") 'table#1
    'DBUtils.DropTable(SQL, "Quep") 'table#2
    'DBUtils.DropTable(SQL, "Quen") 'table#3
    'DBUtils.DropTable(SQL, "Quer") 'table#4
    'DBUtils.DropTable(SQL, "Quec") 'table#5
    'DBUtils.DropTable(SQL, "Quew") 'table#6
    'DBUtils.DropTable(SQL, "Queb") 'table#7
    'DBUtils.DropTable(SQL, "seque") 'table#8
    'DBUtils.DropTable(SQL, "Utilities") 'table#9 (print alert & batt alert)
   
    Try
    '----'table Qno----------------------------------------
    Dim m As Map
    m.Initialize
    m.Put("qno", DBUtils.DB_TEXT)   
    DBUtils.CreateTable(SQL, "Queno", m,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
    '----'table Qp-----------------------------------------
    Try
    Dim m As Map
    m.Initialize
    m.Put("qp", DBUtils.DB_TEXT)
    m.Put("status", DBUtils.DB_INTEGER)
    DBUtils.CreateTable(SQL, "Quep", m,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
   
    '----'table Qn-----------------------------------------
    Try
    Dim m As Map
    m.Initialize
    m.Put("qn", DBUtils.DB_TEXT)
    m.Put("status", DBUtils.DB_INTEGER)
    DBUtils.CreateTable(SQL, "Quen", m,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
    '----'table Qr-----------------------------------------
    Try
    Dim m As Map
    m.Initialize
    m.Put("qr", DBUtils.DB_TEXT)
    m.Put("status", DBUtils.DB_INTEGER)
    DBUtils.CreateTable(SQL, "Quer", m,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
    '----'table Qc-----------------------------------------
    Try
    Dim m As Map
    m.Initialize
    m.Put("qc", DBUtils.DB_TEXT)
    m.Put("status", DBUtils.DB_INTEGER)
    DBUtils.CreateTable(SQL, "Quec", m,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
   
    Try
    '----'table Qw-----------------------------------------
    Dim m As Map
    m.Initialize
    m.Put("qw", DBUtils.DB_TEXT)
    m.Put("status", DBUtils.DB_INTEGER)
    DBUtils.CreateTable(SQL, "Quew", m,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
'    '-----------------------------------------------------
   '----'table Qb------------------
    Try
    Dim m1 As Map
    m1.Initialize
    m1.Put("qb", DBUtils.DB_TEXT)
    m1.Put("status", DBUtils.DB_INTEGER)
    DBUtils.CreateTable(SQL, "Queb", m1,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
    '--UTILITIES-------------------------------------------
    '----'table util-----------------------------------------
    Try
    Dim m As Map
    m.Initialize
    m.Put("prntcnt", DBUtils.DB_TEXT)
    m.Put("prntalert", DBUtils.DB_TEXT)
    m.Put("battalert", DBUtils.DB_TEXT)
    DBUtils.CreateTable(SQL, "Utilities", m,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
'    '-----------------------------------------------------
    '----'table View Numbers in Sequence------------------
    Try
    Dim m As Map
    m.Initialize
    m.Put("number", DBUtils.DB_TEXT)
    m.Put("teller", DBUtils.DB_TEXT)
    DBUtils.CreateTable(SQL, "seque", m,"")
    Catch
    ToastMessageShow("Error creating table",False)
    End Try
'    '-----------------------------------------------------
    '''----------
    ''CheckQuenumForIncerment
    'ResetvalueQno
    '
    'InitvalueQno
    '-----------------------------------------------------
    '
    'AdminResetVal ' use to reset only
    '-----------------------------------------------------
    'CheckQuenum
    'CheckUtilities
    Try
    CheckQuenum
    thePhoneEvents.Initialize("thePhoneEvents")   
    Catch
    ToastMessageShow("Ooops!","errr")
    End Try
    Try
    ICS.Initialize(Activity, Me)
    ICS.NavBarOff
    ICS.ActionBarOff
    Catch
    Log("Not ICS version")
    End Try
   
   
    flagUsbConnect = False       
        Delay(3000)
'        If firstTimeConnect = False Then
'        firstTimeConnect = True
        Msgbox("Initializing!1","Tracking")
        btnOpen
        Msgbox("Initializing!2","Tracking")
        'flagUsbConnect = False
        'End If
    '----Records Counter------
    HowManyRec = 0
   
End Sub

Thanks for the time.
microbox
 

Myr0n

Active Member
Licensed User
Longtime User
Upvote 0

microbox

Active Member
Licensed User
Longtime User
Hi Myron and Erel thanks for the time... I will get back on this thread when I have the appropriate wifi module device working on the specific android development board so that I can do the debugging part.

-microbox
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Here is your issue:

B4X:
ToastMessageShow("Ooops!","errr")

You are passing a string value to a parameter that is expecting a boolean. The bad line is near the bottom of the code you posted (about 25 lines up from the bottom).

- Colin.
 
Upvote 0

Computersmith64

Well-Known Member
Licensed User
Longtime User
Also - to make your app easier to debug & maintain, you might want to move all those Try, Catch, End Try blocks into separate subs & use B4A's built in exception handling instead of a generic message in a toast message.

That way you will:

a) get pointed to the source of the error more accurately - eg: if you have have a sub for the creation of each of your tables & one of them fails, the error will point you directly to that sub, rather than making you go line-by-line through a long sub with multiple code blocks in it; and
b) you will get an error message in your toast (or dialog) that is specific to the cause of the crash.

Just my 2c worth...

- Colin.
 
Upvote 0
Top