Dim t As String = "405006951190111400"
Log("t=" & t)
Dim i As Long = t
Log("i=" & i)
Dim jo As JavaObject
jo.InitializeStatic("java.lang.Long")
Log(jo.RunMethod("parseLong",Array( t )))
Log(jo.RunMethod("valueOf", Array(t)))
Post #2 is correct. But another way is to use BigNumber library by aGraham:
B4X:
Dim t As String = "405006951190111400"
Log(t)
Dim i As BigInteger 'need to download the B4A BigNumber library by aGraham. Needs to be in the B4A additional library folder
i.Initialize(t) '405006951190111400
Log(i) '405006951190111400