Android Code Snippet Check Internet Connection

Use below code for check internet connection
The ip is special for ping and Google is owner this IP
This IP is use DNS cache for speed up ping
And never will this address stop

Sub ping
    Dim status As Boolean
    status    =    Ping("","Report",1,4)
End Sub

Sub Ping(Url As String, ResultsType As String, Attempts As Int, Timeout As Int) As Boolean

    Dim sb As StringBuilder
    Dim p As Phone
    Dim Option As String

    If ResultsType = "Report" Then    Option = " -v "
    If ResultsType = "Summary" Or ResultsType = "Status" Then Option = " -q "

    p.Shell("ping -c " & Attempts & " -W " & Timeout & Option & Url, Null, sb, Null)

    If sb.Length = 0 Or sb.ToString.Contains("Unreachable") Then
        Return False
    End If
    Return True

End Sub