B4J Question Conditional compilation ?

b4auser1

Well-Known Member
Licensed User
Longtime User
I want to create wrapper class for KeyValueStore, that is can be used in B4A and B4J apps.
Is there a way to compile different lines of code for B4A or B4J apps ?
Another more specific workaround for class is to have DirInternal in B4J, which returns the same value as DirApp.

B4X:
'Class module
Sub Class_Globals

    Private m_kvsApp As KeyValueStore

End Sub

'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize()
    'B4A
    'm_kvsApp.Initialize(File.DirInternal, "KeyValueStore")
    'B4J
    m_kvsApp.Initialize(File.DirApp, "KeyValueStore")
End Sub

SQL in B4A uses Cursor, jSQL in B4J uses ResultSet :(
 
Last edited:
Top