You could send a request to Google with the HTTP library.
This site is online most of the time
See this thread: http://www.b4x.com/forum/code-samples-tips/3619-checking-internet-connection.html
There is no real way to force a device to connect to the internet. However depending on the device and the user setting, issuing a request may start a connection.
Sub GPRS_Aufbau
ErrorLabel(ConnectionError)
DoEvents
request.New1("http://www.adress.de") ' init HTML-Object'
request.KeepAlive=True
request.GetResponse
Return
ConnectionError:
End Sub