I am trying to wrap a SKD for a B4A member. The folder structure looks as follows:
src
There are 7 .so files available but System.loadLibrary("ezsdk3.0"); is an 8th system library that needs to be loaded. My guess is that this library somehow needs to be generated from the NetDEVSDK.h file.
The wrapper (DeviceWrapper.java) is probably the wrapper for this interface. It looks as follows:
NetDEVSDK.h is attached to this post
So how do I create ezsdk3.0 from all this other JNI stuff? My own wrapper merely kickstarts MainActivity.java into action as I need to see what this looks like and what it does.
Should all the .mk files and .h files somehow be used to generate ezsdk3.0.xxx (an .so file?)
Help with this will be much appreciated - have never done anything like this.
src
main
In the MainActivity.java of the demo project the 7 .so files are loadedjava
com
jniuniview
smb
ezsdk
demo
6_different_files.java
wrapperDeviceWrapper.java
netdevsdk
Application.mk
ezsdk.cpp
resinclude
Android.mkNetDEVSDK.h
lib7 x .so files
Android.mkApplication.mk
ezsdk.cpp
some res folders and files
B4X:
static {
System.loadLibrary("Curl");
System.loadLibrary("MP4");
System.loadLibrary("mXML");
System.loadLibrary("NDPlayer");
System.loadLibrary("NDRender");
System.loadLibrary("NetDEVSDK");
System.loadLibrary("RM_Module");
System.loadLibrary("ezsdk3.0");
}
There are 7 .so files available but System.loadLibrary("ezsdk3.0"); is an 8th system library that needs to be loaded. My guess is that this library somehow needs to be generated from the NetDEVSDK.h file.
The wrapper (DeviceWrapper.java) is probably the wrapper for this interface. It looks as follows:
B4X:
package com.uniview.smb.ezsdk.wrapper;
import android.util.Log;
import android.view.Surface;
import com.uniview.smb.ezsdk.demo.ChannelInfo;
import com.uniview.smb.ezsdk.demo.DeviceInfo;
import java.util.ArrayList;
public class DeviceWrapper {
private static String TAG = "WRAP";
public native int sdkInit();
public native int sdkLogin(String deviceIP, int port, String userName, String userPass);
public native int sdkLogout(int userID);
public native int sdkGetVersion();
public native int sdkGetLastError();
public native ArrayList<ChannelInfo> sdkGetChlList(int userID);
public native int sdkStartLive(int userID, int channel);
public native int sdkStopLive(int handle);
public native int sdkCapture(int handle, String fileName);
public static native void setRenderSurface(Surface view);
public static boolean sdkInited = false;
public DeviceWrapper() {
if (DeviceWrapper.sdkInited)
return;
DeviceWrapper.sdkInited = true;
sdkInit();
Log.i(TAG, "SDK initialized, version " + sdkGetVersion());
}
public int GetLastError()
{
return sdkGetLastError();
}
public int Login(DeviceInfo deviceInfo)
{
return sdkLogin(deviceInfo.deviceIP, deviceInfo.devicePort, deviceInfo.userName, deviceInfo.userPass);
}
public int Logout(int userID)
{
return sdkLogout(userID);
}
public ArrayList<ChannelInfo> GetChlList(int userID)
{
return sdkGetChlList(userID);
}
public int StartLive(int userID, int channel) {
return sdkStartLive(userID, channel);
}
public int StopLive(int handle) {
return sdkStopLive(handle);
}
public int CapturePic(int handle, String fileName) {
return sdkCapture(handle, fileName);
}
}
NetDEVSDK.h is attached to this post
So how do I create ezsdk3.0 from all this other JNI stuff? My own wrapper merely kickstarts MainActivity.java into action as I need to see what this looks like and what it does.
Should all the .mk files and .h files somehow be used to generate ezsdk3.0.xxx (an .so file?)
Help with this will be much appreciated - have never done anything like this.