F
F
fenix2014-07-01 09:45:22
Android
fenix, 2014-07-01 09:45:22

How is the network transfer protocol implemented in the android game?

Good afternoon. At a new job, I picked up the development of a mobile online game (we will not breed holivars about the expediency of this lesson). The game consists of a server in Java and an android client. At the moment, data from the server to the client and back is transmitted via sockets bit by bit writing to the stream. When transferring more complex objects, hell begins to put it mildly. I want to change the transmission format. For example, write information in json, compress it, transfer it and decompress it at the other end. In general, I want to ask how information is transmitted in "Jedi" projects?

Ps They refused to serialize. iOS client is planned.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2014-07-01
@GavriKos

You confuse levels of abstraction in my opinion. Even if something is written bit by bit into the stream and sent through sockets - it's quite normal. But what exactly is written bit by bit - you did not specify. Json is quite a normal option. You can also get confused with amf - it seems to be even smaller than json. In terms of implementation, you need a layer between the low-level "here is the socket, stuffed bytes and sent" and the high-level "here is the game action, we should notify the server." The layer will shove data into a certain structure (the same json), and give it to a low level, which will still send it byte by byte to the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question