Android Question Custom class templates in B4X

Star-Dust

Expert
Licensed User
Longtime User
I always prefer to create libraries entirely in B4A without using Java. so I ask myself a question:

It is possible to create Custom Class Templates without using Java, but
creating a library entirely in B4A?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Steps required to add custom class templates without creating a java library. You can use it without creating a library at all.

1. Download the attached zip file and put the files in the additional libraries folder.
2. Open the jar file with 7zip or any other zip program. Put all the templates files you like inside the jar. The file extension should be .b4x_excluded.
3. Add a customClass node for each of the templates in the XML file:
B4X:
<customClass>filenamewithoutextension:MyCustomClass, name:This is my cool class template</customClass>
MyCustomClass matches MyCustomClass.b4x_excluded file.
4. Add a reference to this "library" from your project and the classes will appear:
SS-2018-03-12_17.09.41.png


Note that the library will not add anything to the compiled project.

You can of course change the author and version fields.
 

Attachments

  • MyCustomClasses.zip
    1.7 KB · Views: 691
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Is/Will this be available for the other platforms?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
Steps required to add custom class templates without creating a java library. You can use it without creating a library at all.

1. Download the attached zip file and put the files in the additional libraries folder.
2. Open the jar file with 7zip or any other zip program. Put all the templates files you like inside the jar. The file extension should be .b4x_excluded.
3. Add a customClass node for each of the templates in the XML file:
B4X:
<customClass>filenamewithoutextension:MyCustomClass, name:This is my cool class template</customClass>
MyCustomClass matches MyCustomClass.b4x_excluded file.
4. Add a reference to this "library" from your project and the classes will appear:
SS-2018-03-12_17.09.41.png


Note that the library will not add anything to the compiled project.

You can of course change the author and version fields.
Thanks, I find it really useful.

But can you create only custom classes or even services?
Or is it possible to add a personalized service?
 
Upvote 0

Star-Dust

Expert
Licensed User
Longtime User
The idea that came to me is to create a library that contains code snippets like in the forum.

By clicking on the classes / modules and customizable services you can add these snippets to your code.

Thanks to this your new functionality
 
Upvote 0
Top