(04-29-2018, 06:50 AM)BartKindt Wrote: Problem is, I have no idea how to call this. As far as I can understand, it should be called by something like this:
Code:var LNetworkInterface: JNetworkInterface;
LNetworkInterface := TJNetworkInterface.Wrap(TAndroidHelper.Context.getSystemService(TJContext.JavaClass.xxxx ???
No, that is not correct. As I said earlier, given an IP address of a network interface, use the static NetworkInterface.getByInetAddress() method, eg:
Code:
LNetworkInterface := TJNetworkInterface.JavaClass.getByInetAddress(TJInetAddress.JavaClass.getByName(StringToJString('IP Address here')));
(04-29-2018, 06:50 AM)BartKindt Wrote: PS: "such as getifaddrs() (...but there is a 3rd party implementation at https://github.com/morristech/android-ifaddrs)." is in C code, which I cannot use..
You can, if you translate it to Pascal, or pre-compile it into a static native library that your Pascal code then links to.