Android Question Problems with callsub and properties

F.Campanella

Member
Licensed User
Longtime User
Hi,
unfortunately I still have problems when I use callsub for read properties to another class module.

In my project I use one class only and I use another class when I load a collection of classes through DB.

B4X:
     Dim DB As CLMeteoAppDBLocalita
     DB.Initialize("meteoapp")
     If DB.IsInitialized Then
    
       Localita.Initialize
       Dim MAL As CLMeteoAppLocalita
       MAL.Initialize
       MAL.DBOrder = "loc_localita"
       Localita = DB.LoadCollection(MAL)
       Cities.Initialize
    
       For i = 0 To Localita.Size -1
         MAL = Localita.GetValueAt(i)
         Cities.Add(MAL.Localita & " (" & MAL.Provincia & ")")
       Next
    
       DB.Close
     End If

In the module "CLMeteoAppDBLocalita" I use CallSub to read a property, in this case the ID property

B4X:
Dim sType As String = CallSub(oElement, "Get" & Field & "Type")

If I compile in release mode the app work correctly but if I compile in release obfuscated mode the app retrieve this error: sub:clmeteoappdblocalita_vvvvvvvvvvvvvvv7 (java line:242)java.lang.Exception: Sub getidtype was not found.

I Use this method because in other situations I have several class that has the same properties for the efficient loading of the DB and only DB class for load all classes.

Can you help me?
 

Roycefer

Well-Known Member
Licensed User
Longtime User
I think obfuscated mode will scramble all method/field names that don't have an underscore in them. You'll have to rename your field or method names to have an underscore to prevent them from being scrambled by the obfuscator.
 
Upvote 0
Top