1

Topic: Instant messaging

Kind time of days all!
I create a toy on response, the mode of one player is already ready.
Now I want to add a multiple user mode, the council is necessary, what tool is better for using for the instant exchange of the auxiliary messages between players (to define who the first pushed).
If to use  there is a restriction on distance between players, and it was to be avoided.
Thought towards push-notices on basis firebase, but here I do not like that fact that if at the player application inactively all these notification messages "get" through their standard receiver.
Can eat any more elegant decision?
Yours faithfully, Valera.

2

Re: Instant messaging

Wifi direct?
https://developer.android.com/training/ … irect.html
On  there are examples.

3

Re: Instant messaging

wadman;
At thanks big, I will look now!

4

Re: Instant messaging

It is possible as a chat on sockets

5

Re: Instant messaging

http://android-er.blogspot.ru/2014/08/i … -chat.html

6

Re: Instant messaging

Oleg Shishkin;
Thanks for the link!

7

Re: Instant messaging

Oleg Shishkin;
Arose . Namely: at usage of sockets, if one creates game (type) second, to be connected, it is necessary to know a server socket its ip-address and to enter it. For a toy it somehow not comme il faut...

8

Re: Instant messaging

Saw the grid scanner (search of 256 addresses at constant port) - not for long occupies

9

Re: Instant messaging

But it for wi-fi

10

Re: Instant messaging

If will be through a network of the provider - all the same it is necessary to transfer the server address - it is possible messengers c with opened API

11

Re: Instant messaging

And what if in this circuit to add the selected server from an unpretentious DB where ip-addresses of the created server sockets will be stored?

12

Re: Instant messaging

And this decision - the main thing in such things - reliability - and that of fools much - can and play a dirty trick

13

Re: Instant messaging

I.e. algorithm such:
- Read from the server the list of servers

14

Re: Instant messaging

I.e. algorithm such:
- Read from the server the list of servers
- Check communication type (wi-fi or the provider)
- Read out the IP the address and select in it a mask of the network
- If is wi-fi suggest or to be connected to local (if it is) or deduce the list of possible servers. Otherwise - simply choice from the list

15

Re: Instant messaging

https://stackoverflow.com/questions/167 … ss-android
https://stackoverflow.com/questions/202 … -my-device