Android Tutorial Library compilation - Compile your project to a library

gjoisa

Active Member
Licensed User
Longtime User
Trying to test Library compilation and using the lib in other projects . Totally confused . For testing purpose wrote a small piece of code and compiled . Attching the project here . Please help to solve the problem .
 

Attachments

  • MathLib.zip
    11.4 KB · Views: 701

gjoisa

Active Member
Licensed User
Longtime User
After adding .jar and .xml file to Library folder , I checked library in my project . But how declare a variable which uses Lib's function ?
 

JesseW

Active Member
Licensed User
Longtime User
First off, Erel, THANK YOU SO VERY MUCH for this addition!! We've been needing this for a while now.

...- Code obfuscation - Libraries can be obfuscated during library compilation. Strings will not be obfuscated in this mode.

Will the strings in an obfuscated library be obfuscated in an obfuscated project that includes the library?

Jesse
 
Last edited:

EduardoElias

Well-Known Member
Licensed User
Longtime User
Erel,

My question is about debug.

I have divided my app in many libraries.

I see the Log function appears to not be working from inside the libraries.

Is it possible to generate libraries with debug info? is it possible to trace? or at least make the Log function work that can be viewer on IDE logcat?

Thanks

Eduardo
 

Jaames

Active Member
Licensed User
Longtime User
Hi !

Is it possible to include resources in the compiled library ?

:sign0098: and thanks for this feature
 

abner69

Member
Licensed User
Longtime User
Thanks Erel for a Great Job!

I am wondering, other than editing the libs xml file, is there an easier way to include comments on how to use each function (help)?

...Pablo
 

qsrtech

Active Member
Licensed User
Longtime User
Compile Library - include Layout File

Hi, Can't seem to find this anywhere (no pun intended lol). But how can we go about including a layout file in our library?
 

jcredk

Member
Licensed User
Longtime User
Sorry to ask as I am a bit new to B4A:

Coming from MS C# SharpDX, one thing that was a bit fustrating for me with B4A was the capacity to share reuse (proven bug-free) code in libraries.
I discovered the compile to library in the menu, that should solve my issue but it's usage is still not fully clear to me.

Could it be possible in this tutorial to add a sample with following code to download:
- a library project with a class "MathObj" and a function "Add2Numbers(a as integer, b as interger) as integer"
- a main project with an activity 2 fields (for a & b) and a "+" button) that would create an instance of "MathObj" and would do the sum in a 3rd field

This may help to understand the concepts and upper mentionned attributes !?

Thanks in advance
Jo
 

jcredk

Member
Licensed User
Longtime User
You could make a Class for this.
Have a look at the User's Guide chapter 10 Class modules
Best regards.
I am not sure to understand: my point is to get a full working sample with a library and a main project: having proposed a class within the library is just for demonstration purpose ... !?
 

klaus

Expert
Licensed User
Longtime User
You should try to do it on your own and if you have trouble you can ask for help.
You could write a Class for this purpose and compile it to a library.
Did you have a look at the User's guide there you find an example with the code, not the solution you ask for but the whole principle is explained.

Best regards.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…