Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
IdTCPClient on Android: Connecting to non-active network
#17
(05-10-2018, 07:16 PM)BartKindt Wrote: I was hoping I could bypass the Android system and use Indy's way of selecting the interface.

That would be nice.  But Android is a managed platform, Google doesn't really want users going down to the Linux level unless they really need to.  But, since Delphi Android apps operate inside the Java native NDK, Indy operates at the Linux POSIX level, not at the Android Java level.

(05-10-2018, 07:16 PM)BartKindt Wrote: I will try the Android-based ideas you gave me and see what I can and cannot do with that.

See Connecting your App to a Wi-Fi Device on the Android Developers Blog.

However, despite what is documented, I see from Android's source code that:

And according to Linux's documentation:

Quote:SO_MARK (since Linux 2.6.25)
             Set the mark for each packet sent through this socket (similar
             to the netfilter MARK target but socket-based).  Changing the
             mark can be used for mark-based routing without netfilter or
             for packet filtering.  Setting this option requires the
             CAP_NET_ADMIN capability
.

So again, you might need root/sudo access to bind a socket to a specific network.  Unless Android's INTERNET or NET_ADMIN permissions enable CAP_NET_ADMIN, but I don't think they do.  So, I'm still at a loss of how to proceed here.  You could try what the blog says, or you could try using SO_MARK directly, and hope it somehow works out OK in your app without messing around with permissions too much.

(05-10-2018, 07:16 PM)BartKindt Wrote: The biggest problem is that I cannot find anywhere a forum where I can actually ask Delphi-Android based questions, and get actually a real answer.

In the absence of the Embarcadero forums, you can ask Delphi-related questions in the Delphi section of this same forum server, or in the Delphi section of StackOverflow, or any number of other Delphi forums scattered online (though I only frequent the ones I have mentioned).

Reply


Messages In This Thread
RE: IdTCPClient on Android: Connecting to non-active network - by rlebeau - 05-10-2018, 08:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)