Hello there,
I'm trying to write a wrapper for a library that allow users to access NVR video data.
My java level is very very basic but the SLC compiled the library without errors.
B4A give me the following java error when i click compile:
Do i have to write a contructor in the Java code?
This is my java wrapper class:
Android SDK is Android-28
JAVA is jdk1.8.0_111
I'm trying to write a wrapper for a library that allow users to access NVR video data.
My java level is very very basic but the SLC compiled the library without errors.
B4A give me the following java error when i click compile:
B4X:
javac 1.8.0_111
src\com\csi\tvtWrapper\main.java:373: error: cannot find symbol
public static DvrSdkHelper _tvt = null;
^
symbol: class DvrSdkHelper
location: class main
Note: src\com\csi\tvtWrapper\starter.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
Do i have to write a contructor in the Java code?
This is my java wrapper class:
B4X:
import java.io.IOException;
import com.sdk.interfance.*;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.*;
@Version(1.0f)
@ShortName("DvrSdkHelper")
//@ActivityObject
//
public class DvrSdkHelper {
public nvrsdk SdkInterface;
private String _Username;
private String _Password;
private String _IP;
private Short _Port;
private String _sn;
private int _UserID;
private NET_SDK_DEVICEINFO _DeviceInfo;
private int _ConnectType;
private byte RetBytes[];
public void Initialize(BA ba){
/*_Username = username;
_Password = password;
_IP = ip;
_Port = port;*/
_sn = " ";
_ConnectType = NET_SDK_CONNECT_TYPE.NET_SDK_CONNECT_TCP;
_UserID = -1;
}
//Properties
public String getIP() {
return _IP;
}
public void setIP(String value) {
_IP = value;
}
public Short getPort() {
return _Port;
}
public void setPort(Short value) {
_Port = value;
}
public String getUsername() {
return _Username;
}
public void setUsername(String value) {
_Username = value;
}
public String getPassword() {
return _Password;
}
public void setPassword(String value) {
_Password = value;
}
public int getConnectType() {
return _ConnectType;
}
public void setConnectType(int value) {
_ConnectType = value;
}
//DeviceInfo Structure
public NET_SDK_DEVICEINFO getDeviceInfo() {
return _DeviceInfo;
}
//----------
public boolean ConnectToNvr(BA ba) throws IOException {
byte RetBytes[] = SdkInterface.LoginEx(_IP, _Port, _Username, _Password, _ConnectType, _sn, _UserID);
//
if(RetBytes == null)
{
//int errNo = SdkInterface.GetLastError();
//Raise event with error number
//RaiseError(ba, errNo);
return false;
}
else
{
_DeviceInfo = NET_SDK_DEVICEINFO.deserialize(RetBytes, 0);
return true;
}
}
public int GetLastError(BA ba)
{
return SdkInterface.GetLastError();
}
/*public void RaiseError(BA ba, int errorNumber)
{
}*/
public byte[] getLoginResponse(BA ba) {
return RetBytes;
}
}
Android SDK is Android-28
JAVA is jdk1.8.0_111