Android Question Creating reusable artifacts with B4A

Haris Hafeez

Active Member
Licensed User
Longtime User
Is there a 'best practices' approach to building some functionality in B4A (such as a custom panel view) and using it outside B4A like in another app written in Java?

For example, if I have my own custom list view implementation in B4A, how to use it in an android app that will be written in Java?
 

Cableguy

Expert
Licensed User
Longtime User
I would say that, once compiled as a library, it becomes converted to java ( a jar and XML file is generated), so it should be possible to use them in a Java written app
 
Upvote 0

Haris Hafeez

Active Member
Licensed User
Longtime User
Thanks. I'll admit I've never used the 'Compile to Library' feature before so bear with me on this.

When we do compile a project to library, are activities and classes and methods all exported such that their names are the same as in B4A? From what I can recall, the generated code follows a certain pattern (such as lower case, underscore character used for members and methods etc).
 
Upvote 0

Roycefer

Well-Known Member
Licensed User
Longtime User
You can explore the ProjectName/Objects/src directory to see the generated .java files after a compilation.
 
Upvote 0

Haris Hafeez

Active Member
Licensed User
Longtime User
That's what I wanted to figure out.

I understand there's good support for using java libraries and code in B4A but I have a potential use case where my B4A project has large parts that a third party wants to use in their java android app. They're not B4A converts yet(I'm trying:)
 
Upvote 0
Top