I want to write a simple toy in which the search for the player and the game with him will be implemented. Everything should be without failures, ie the connection should be permanent. How is this possible to implement? HttpUrlConnection and threads? Or maybe some library? Need to have some kind of session? Please explain and poke nsom where to dig

    2 answers 2

    TCP / IP connection, but you need to consider that Android is mainly used for mobile devices, respectively, we have all the delights of GSM / GPRS, and "not a single gap" will not work

    • Will not it be possible in the gameplay of the game itself to beat the situation of loss of communication? this type of augmented reality - Dmitry Ponyatov
    • As far as I know, TCP / IP is a set of protocols for data transfer, but not PERMANENT CONNECTION, - Nikotin N

    Try connecting on sockets. This is essentially a standard solution to support continuous communication.