Must Have Check Network Connectivity State Library For #Delphi XE8 Firemonkey On #Android And #IOS


Developer Dave Nottage has upgraded his network state library for Delphi XE8 Firemonkey. The latest version of the component includes an IOS64 version of the static libReachability.a library. If you are doing any kind of internet connections in Delphi XE8 this is a must have library. You should check if there is an internet connection on Android, IOS, OSX, and Windows prior to attempting to making a connection. The component is free. Even if you are only using the app tethering functionality of Delphi XE8 Firemonkey you should also use this component. There are multiple ways to check for an internet connection and this is one of them. In certain instances it is not enough however to just use the library (like for example when an IOS device has it’s internet connection disabled). A second important piece that I use is this function created by Daniel Magin (you can change out the host for your own domain name):
function TdmMain.CheckInternet: boolean;
Be aware however that on IOS you must make internet connections asynchronously otherwise you risk the chance that IOS will close your application. If your connection takes more than ~10 seconds IOS may think your app is frozen and close it. What I do is set up a private boolean variable which contains the internet status. I then update this variable using the various methods and when I need to know the internet state I just check the boolean variable. This library and code should also work in Appmethod. You can check out our previous post about the network state component here.
Head over and download the network state component library for checking the internet connection in Delphi XE8 Firemonkey.

Comments are closed.