I know it was answered long ago, but now I can't find it
Start a B4A project and add your custom functions to a
code module (not a
class module). For instance, you create a code module named
myFunctions
Sub add(a As Int, b As Int) As Int
Return a+b
End Sub
Sub multiply(a As Int, b As Int) As Int
Return a*b
End Sub
Then compile it as a lib, giving it the name that you want, and it will be added to the additional libraries folder.
From your main project, just reference this library, and you can use the functions directly in the code, using
moduleName.methodName syntax, and no need to declare nor initialize them in advance
Sub mySub
'...
Dim c As Int = myFunctions.add(3,4)
'...
End Sub