I am trying to wrap a usb printer library. It's have a USBController class (as attached img) to control the usb device and the class is initialize with a Java Activity and handler [ UsbController(Activity, Handler) ]. What shall I use to pass into the class to initialize it?
B4X:
import com.zj.usbsdk.PrintPic;
import com.zj.usbsdk.UsbController;
import android.app.Activity;
import android.hardware.usb.UsbDevice;
import android.os.Handler;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.ActivityObject;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
@DependsOn(values={"usbsdk", "android-support-v4"})
@ShortName("USBPrinter")
@Version(1.0f)
@ActivityObject
public class USBPrinterWrapper {
UsbController usbCtrl = null;
UsbDevice dev = null;
private int[][] u_infor;
private byte isHasPaper;
private Handler mHandler;
public void Initialize(BA ba, String EventName) {
usbCtrl = new UsbController(ba, mHandler);
}