How to add or include a class or lib?

Charlie_M

Member
Licensed User
Longtime User
Hi Guys,

I have added a library and I want to use it. How do I add it as a module? I hope I got this right.
 

giga

Well-Known Member
Licensed User
Longtime User
Hi Guys,

I have added a library and I want to use it. How do I add it as a module? I hope I got this right.

Modules are added from the top bar under Project, make sure you have selected the library on the right column and then you DIM the library.

Hope that helps.
 
Upvote 0

Charlie_M

Member
Licensed User
Longtime User
Thanks for the reply. Sorry to be so dense,but can I have a example please?

:sign0085:
 
Upvote 0

drachmad

Member
Licensed User
Longtime User
Unzip the library
Copy the .jar and .xml to the folder b4android/LibrariesAdd. Don't put it in the folder Library!
Don't forget to set the path using Tools->Configure Paths->Additional Libraries
Check at the Libs tab, Refresh if necessary.

Copy the class to the project folder where your xxx.b4a located
Open your project.
Project->Add Existing Module->point to the class you have added.

I hope it helps
 
Last edited:
Upvote 0

Charlie_M

Member
Licensed User
Longtime User
Hi drachmad,

Well I did copy the two files to the Library folder. I guess I will have to remove them. Thanks for the help. I am sure I will be back.
 
Upvote 0

Charlie_M

Member
Licensed User
Longtime User
Copy the .jar and .xml to the folder b4android/LibrariesAdd

Where is this LibrariesAdd folder? What I did is make a new folder called UserLibs and put it in the Android folder. I then open B4a and put the path to that folder in the "Additional Libraries" field, but the new lib. does not show up in the library reference.
 
Upvote 0

gregwa

Member
Licensed User
Longtime User
In my setup I called the folder "AdditionalLibs". I manually created the folder under "C:\Program Files\Anywhere Software\Basic4Android" then pointed to it in the Paths Configuration tool. That's where all the 3rd party library files should go. It really doesn't matter what you name that folder. Drachmad uses "LibrariesAdd".
 
Upvote 0

giga

Well-Known Member
Licensed User
Longtime User
Where is this LibrariesAdd folder? What I did is make a new folder called UserLibs and put it in the Android folder. I then open B4a and put the path to that folder in the "Additional Libraries" field, but the new lib. does not show up in the library reference.

1. You have to make sure the .jar and .xml are both the in the libraries folder.
2. Then close and open b4a or right click on the column and (refresh) the column then look for the name of the library.

3.Then (i.e go to Sub Global and type) Dim testlib As *libraryname*

*libraryname* being the library name

4. then test functionality (i.e testlib.) that should show library content.

type testlib.


Good Luck , :)
 
Upvote 0
Top