how check internet connection in android?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By mmodream

hi, how check internet connection in android?

in the android export permissions is "access network state "; how i could work with it?

for example: no internet : “show message to user: No internet” hehe xD


Edit: actually i’m doing :

if (net.create_client(ip, server_info.used_port) != OK):
	print_debug("Failed to create client")

but this is not the optimal form, cause the server could be off and the client has a normal network connection

:bust_in_silhouette: Reply From: jgodfrey

Generally, you’d probably need to leverage the HTTPClient or HTTPRequest classes in Godot. Here’s a project that wraps up the necessarily functionality into something more like what you’re after…