Android Question Get B4A version from code?

RB Smissaert

Well-Known Member
Licensed User
Longtime User
Is there a way to get the B4A version (used to compile the code, currently 13.50) with code?

RBS
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    Dim CoreVersion As Float = Me.As(JavaObject).RunMethod("getVersion", Null)
    Log(CoreVersion)
End Sub

#if Java
public float getVersion() {
    return anywheresoftware.b4a.keywords.Common.class.getAnnotation(anywheresoftware.b4a.BA.Version.class).value();
}
#End If

This exact code will also work in B4J.
 
Upvote 0
Top