Android Question How to "locate" the module of a java inline code?

EduardoElias

Well-Known Member
Licensed User
Longtime User
I have created a wrapper for a library using inline java

B4X:
#if java
import android.content.Context;
import android.app.Activity;

import java.util.HashMap;
import java.util.List;

import ca.nexu.nexupayment.NexuPayment;
import ca.nexu.nexupayment.NexuPaymentPrinterListener;
import ca.nexu.nexupayment.NexuPaymentTransactionListener;

public static class nexutransaction implements NexuPaymentTransactionListener, NexuPaymentPrinterListener {

it is part of a class module.

I have compiled it to a library (alt+f5)
and now i need to use it in another app.

the initialize sub in this library is like that:

B4X:
    nexupayment = start.InitializeNewInstance(Application.PackageName&".ynexu.nexutransaction", Null)

it works in my test app, where the class module is just a class of the app.

Now that this is a library and I am referencing it by the Libraries Module it is not finding my JAVA inline CLASS.

I dont know how to find it, I have tried many things. I dont understand how the java PATH is for initialize a new instance.

Any help?
 

EduardoElias

Well-Known Member
Licensed User
Longtime User
Don't. Create a b4xlib instead. Just zip the files and set the extension to be b4xlib. This way the package name will be as the package of the containing app.

a) I dont know how to create b4lib, I read a little about this and understood I need to make a zip and rename it, but it was not clear for me what to put inside it.

I have this yNexy.bas file that is a class module, that works in my base test app to develop it. There is a .aar file that is the library. What got to be together inside this b4xlib?


b) considering the use as compiled library:

it is only missing this naming path in order for the entire thing to work.

in the target app I have tried:

yashar.yTEF.ynexu.nexutransaction
ynexu.nexutransaction
nexutransaction
Main.nexutransaction
 
Upvote 0
Top