A
A
arsden22016-11-19 22:07:39
libgdx
arsden2, 2016-11-19 22:07:39

How to check internet availability in LibGdx?

I am making an online game on LibGdx and NodeJS with a connection to a VPS and then I ran into a problem:
The first thing I decided to do is to check the availability of the Internet every time a client enters the game. Well, I turned on the Internet:
8016f57646594d05b3d817ab8718597d.PNG
And I decided to check with this code:
9f81482466e446b18de4387233dbb754.PNG
Here is the interface that is used
27042223073349c39dfe97f95d79d0e4.png
and the class
ccd883dc6115453bad02d0edf9a3fa83.PNG
And just a screen that appears if the Internet is available.
Well, on the computer it somehow works, but on the android it displays the program has completed its work.
Help solve the problem!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
ratatyq, 2017-09-22
@ratatyq

All Internet requests must be executed in a separate thread

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question