I am trying to convert this library to mke USB Camera working on B4a.
https://github.com/suethan/AndroidUSBCamera/blob/master/README.md
I am using SimpleLibraryCompiler tool, I modified the original library because as is it doesn't compile with this tool.
Now; if I compile the library without wrapper it compiles without errors (except for warnings ShortName missing).
I tried to create the wrapper:
but because I am not a Jva expert I have this error:
Could you help me ?
Thank you
Here the files:
https://github.com/suethan/AndroidUSBCamera/blob/master/README.md
I am using SimpleLibraryCompiler tool, I modified the original library because as is it doesn't compile with this tool.
Now; if I compile the library without wrapper it compiles without errors (except for warnings ShortName missing).
I tried to create the wrapper:
B4X:
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.Author;
import anywheresoftware.b4a.BA.DependsOn;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import anywheresoftware.b4a.keywords.Common;
import com.dreamguard.api.USBCamera;
import android.content.Context;
import android.graphics.SurfaceTexture;
import android.hardware.usb.UsbDevice;
import android.util.Log;
import android.view.Surface;
import android.widget.Toast;
import com.dreamguard.usb.camera.CameraHandler;
import com.dreamguard.usb.detect.DeviceFilter;
import com.dreamguard.usb.detect.USBMonitor;
import com.dreamguard.usb.detect.USBStatus;
@Author("Suethan")
@Version(1.0f)
@ShortName("USBCamera")
public class USBCameraWrapper {
public void init(Context context) {
USBCamera.init(context);
}
}
B4X:
Starting step: Compiling Java code.
javac 1.8.0_65
C:\Users\Tommaso\Desktop\CameraUSB\ee\src\main\java\com\dreamguard\USBCameraWrapper.java:26: error: non-static method init(Context) cannot be referenced from a static context
USBCamera.init(context);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\Tommaso\Desktop\CameraUSB\ee\src\main\java\com\dreamguard\renderer\RenderHandler.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Error.
Could you help me ?
Thank you
Here the files:
B4X:
AndroidUSBCamera-masterModifiedB4A https://drive.google.com/open?id=1abAFBU4_m3fT_1IHM1kmJejUJ0QjeYoY
AndroidUSBCamera-masterOriginal https://drive.google.com/open?id=1PEsiuj_XMLvEqEJp66y6mukHCkvGU91c