G gerredtor Active Member Licensed User May 12, 2016 #1 Hello, i would like to proove if there is an Internet Connection. I am doing that at the Moment with a code that prooves the ping to 8.8.8.8. But i noticed that there are Smartphones like the Samsung S3 which doesn`t allow that test. Are there any other possibilities except the attempt to download a file? with HTTPJob My code: Code: Copy Dim ph As Phone Dim Response, Error As StringBuilder Response.Initialize Error.Initialize ph.Shell("ping -c 1 8.8.8.8",Null,Response,Error) If Error.ToString="" Then Return True Else Return False End If And i have try This code Code: Copy #If JAVA public boolean isInternetAvailable() { try { java.net.InetAddress ipAddr = java.net.InetAddress.getByName("google.com"); if (ipAddr.equals("")) { return false; } else { return true; } } catch (Exception e) { return false; } } #End If Sub pruefeInternet As Boolean Return jo.RunMethod("isInternetAvailable",Null) End Sub But this error comes: Code: Copy Sub_main_pruefeinternet.... java.lang.RuntimeException: Method: isInternetAvailable not found in: android.widget.TextView
Hello, i would like to proove if there is an Internet Connection. I am doing that at the Moment with a code that prooves the ping to 8.8.8.8. But i noticed that there are Smartphones like the Samsung S3 which doesn`t allow that test. Are there any other possibilities except the attempt to download a file? with HTTPJob My code: Code: Copy Dim ph As Phone Dim Response, Error As StringBuilder Response.Initialize Error.Initialize ph.Shell("ping -c 1 8.8.8.8",Null,Response,Error) If Error.ToString="" Then Return True Else Return False End If And i have try This code Code: Copy #If JAVA public boolean isInternetAvailable() { try { java.net.InetAddress ipAddr = java.net.InetAddress.getByName("google.com"); if (ipAddr.equals("")) { return false; } else { return true; } } catch (Exception e) { return false; } } #End If Sub pruefeInternet As Boolean Return jo.RunMethod("isInternetAvailable",Null) End Sub But this error comes: Code: Copy Sub_main_pruefeinternet.... java.lang.RuntimeException: Method: isInternetAvailable not found in: android.widget.TextView
somed3v3loper Well-Known Member Licensed User Longtime User May 12, 2016 #2 Did you add this before trying to run the method jo.InitializeContext? Upvote 0
G gerredtor Active Member Licensed User May 12, 2016 #3 Code: Copy If FirstTime Then jo.InitializeContext .... . yes Upvote 0
LucaMs Expert Licensed User Longtime User May 12, 2016 #4 gerredtor said: Are there any other possibilities except the attempt to download a file? with HTTPJob Click to expand... I tried many times with Ping without success, then I think the answer should be: no Upvote 0
gerredtor said: Are there any other possibilities except the attempt to download a file? with HTTPJob Click to expand... I tried many times with Ping without success, then I think the answer should be: no
somed3v3loper Well-Known Member Licensed User Longtime User May 12, 2016 #5 It is working on my device but returns false Upvote 0