Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IdTCPClient on Android: Connecting to non-active network
#9
(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.

Reply


Messages In This Thread
RE: IdTCPClient on Android: Connecting to non-active network - by rlebeau - 05-07-2018, 06:24 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)