Android Tutorial [java] Creating libraries for B4A

Avansys

Member
Licensed User
Longtime User
And respect of read the link, I read it, but I didn't understand it :(
Is there an example easier than the last example?
Or maybe, Is there other form for do it?
 

Avansys

Member
Licensed User
Longtime User
I found my error, I didn't add the paypal .jar =), but now I get this problem:


java.lang.NoClassDefFoundError: com.richard.avansys.APayPal
at com.avansys.testultracable.ventanapagos._globals(ventanapagos.java:461)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:169)
at com.avansys.testultracable.ventanapagos.initializeGlobals(ventanapagos.java:230)
at com.avansys.testultracable.ventanapagos.afterFirstLayout(ventanapagos.java:86)
at com.avansys.testultracable.ventanapagos.access$100(ventanapagos.java:16)
at com.avansys.testultracable.ventanapagos$WaitForLayout.run(ventanapagos.java:74)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:130)
at android.app.ActivityThread.main(ActivityThread.java:3824)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:864)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:622)
at dalvik.system.NativeStart.main(Native Method)

I followed the Youtube instructions, but I get this problem. In my test library I have a class that does a simple sum.
 

kepler

Active Member
Licensed User
Longtime User
Hello,

I've tryed the simple method showned, but I was only able to retrieve the xml file, not the jar....

What am I doing wrong?

Kind regards,

Kepler
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
I normally use the SLC, but with with library I need to use the .so files embedded in this library, I don´t know if with SLC is it possible, then I take a look in eclipse way.

What you recommend with this scenario?

B4A Library + libxxxxxx.so
How to compile with SLC?

And where is .so file is saved? The structure for that?

Thanks​
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
Someone knows how to embedded a .jar file inside a library?

I mean, to create a library developed in Java with dependence on another, but at the end of compilation only requires a single .jar and .xml that need B4A

Example:

I create a MyLib.xml and MyLib.jar

But the MyLib.jar depends on Third.jar.


I don´t want to send separately a different library, want you to be embedded in MyLib.jar.

it's possible?

Thanks
 

DonManfred

Expert
Licensed User
Longtime User

cimperia

Active Member
Licensed User
Longtime User
I think it's possible. You use Jar to extract both jars and then Jar again to combine then in one Jar.

B4X:
jar -xvf MyLib.jar
jar -xvf Third.jar

rm MyLib.jar Third.jar

jar -cvf MyLib.jar
 
Top