Hi
I use Waiting For JobDone for check internet status
Acctually i download file and if jobdone is successfully so intertnet is active and not downloaded so internet is disactive
And set timeout for download
Is it good way for check internet?
Hi
I use Waiting For JobDone for check internet status
Acctually i download file and if jobdone is successfully so intertnet is active and not downloaded so internet is disactive
And set timeout for download
Is it good way for check internet?
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://www.google.com") 'or better the link that you want to access
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
'there is an internet connection
End If
j.Release
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://www.google.com") 'or better the link that you want to access
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
'there is an internet connection
End If
j.Release
Dim webview1 As WebView
webview1.Initialize("webview1")
webview1.LoadUrl("http://www.google.com")
Sub webview1_PageFinished (Success As Boolean, Url As String)
If Success Then
Log("there is internet connection")
Else
Log("No internet connection)
End If
End Sub
but in b4a i have no Success (Boolean) returned on PageFinished Event, is there a specific reason why?
EDIT: btw your solution is good for b4a 7+ but not everyone has b4a 7+ and also no Wait For function.
I personally use MLWifi when managing my WiFi networks, I then use WiFiNetworks.isOnLine to test if I'm on the internet or not. You can also use ServerSocket and test if you current IP address is 127.0.0.1, if it is then you are not on the internet.
I don't believe in using google or any other website for that fact just to see if you are online when there are plenty of tools/libraries for B4A to do that for you
I personally use MLWifi when managing my WiFi networks, I then use WiFiNetworks.isOnLine to test if I'm on the internet or not. You can also use ServerSocket and test if you current IP address is 127.0.0.1, if it is then you are not on the internet.
I don't believe in using google or any other website for that fact just to see if you are online when there are plenty of tools/libraries for B4A to do that for you
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://www.google.com") 'or better the link that you want to access
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
'there is an internet connection
End If
j.Release
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://www.google.com") 'or better the link that you want to access
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
'there is an internet connection
End If
j.Release
Erel tis way is good but i need to test internet connection inline not after download file
Assume when i go to 20 line,i need test connection and then continue to other line but in this way,i can detect connection after download file
How i stop it in JobDone line?