### B4J Library create using Java XML

Steps to create Java classes and use the library (xml and jar file)
The B4A tutorial
Please find also information (B4A based) here:
http://www.b4x.com/android/forum/threads/creating-libraries-for-basic4android.6810/
The video tutorial is available here:
http://www.b4x.com/forum/libr...1-video-tutorial-creating-simple-library.html
Creating a Library Using Eclipse
1)Update the designer name (set the build date) and the version in file jrlutils.java
Examples
@BA.DesignerName("Build 20131119")
@BA.Version(0.72F)
2)Build XML file
Menu Project > Generate Javadoc >
a)In javadoc command: locate your javadoc.exe
(Example C:\Program Files (x86)\Java\jdk1.7.0_25\bin\javadoc.exe)
b)Select Types: Ensure to activate all the classes to be exported
Create PUBLIC javadoc members
c)Use custom Doclet: BADoclet (be exact on the case!!!)
Doclet Class path: c:\Daten\b4j\doclet (Note: download first the BADoclet from B4A website)
Do not forget to select the java project jRLUtils
d)Extra Javadoc options: -b4atarget "c:\Daten\b4j\opensource\rolibs\jrlutils\jrlutils.xml"
JRE source compatibility: 1.7
After clicking finish the log shows:
-b4atarget, c:\Daten\b4j\opensource\jrlutils\jrlutils\jrlutils.xml]
starting....
Working with class: com.rwblinn.rljutils
Working with class: com.rwblinn.OpenWebbrowser
Working with class: com.rwblinn.OpenEMail
Working with class: com.rwblinn.ClipBrd
finish: c:\Daten\b4j\opensource\rolibs\jrlutils\jrlutils.xml
3)Build jar file
Menu File > Export > Java > Jar File >
a)Export destination: c:\Daten\b4j\opensource\rolibs\jrlutils\jrlutils.jar
b)Copy jrlutils.jar and jrlutils.xml to the b4j library folder
Example: c:\Program Files (x86)\Anywhere Software\B4J\Libraries\
You need admin rights to do so!
4)Start B4J > Tab Libs > right click Refresh > jRLUtils is listed > Activate
Example using Clipboard Functions
Dim c As ClipBrd
c.CopyStringToClipboard("My Text to Clipboard")
s = c.PasteStringFromClipboard
Hint:
After defining Dim c As ... a drop down list will appear.
In there you'll find the classes defined CopyStringToClipboard, PasteStringFromClipboard.
Creating a Library using Simple Library Compiler
The jSLC tool to build the library can be used as well, which is available together with the
Simple Library Compiler (SLC) tool.
Find more here:
http://www.b4x.com/android/forum/threads/tool-simple-library-compiler-build-libraries-without-eclipse.29918/

Changed: , Category: Libraries, File: T6C214M1557.htm, ID: 1557