H
H
hcvbhc2015-12-14 10:46:09
Mobile development
hcvbhc, 2015-12-14 10:46:09

Is it possible to write a client-server for a smartphone?

Is it possible to write a smartphone application that is both a client and a server?
The application must work on 2 arbitrary smartphones that are connected to 3G or wifi.
Those. so that you can take 2 smartphones and transfer data between them without a connecting server.
At the same time, ip addresses are known and registered at the time the application is launched.
It's just not clear, but what if the ip is dynamic or this one doesn't matter?
And what could be the limitations of such an application?

Answer the question

In order to leave comments, you need to log in

5 answer(s)
S
Stanislav Makarov, 2015-12-14
@Nipheris

And what could be the limitations of such an application?

The operation of such an application [without an intermediary server] can and will be limited by the fact that gray IP addresses are used in the mobile provider's network, as well as more aggressive default routing settings that are unlikely to allow TCP connection from one client device to another.
PS I draw your attention to the conditions "arbitrary smartphone", "3G", "without a link server". For me, "arbitrary" is when one smartphone sits in Volgograd, and the other in Murmansk.

N
Nicholas, 2015-12-14
@ACCNCC

It is forbidden! Look towards webrtc

A
aol-nnov, 2015-12-14
@aol-nnov

peer to peer, but you still need a third party at the start

U
uvelichitel, 2015-12-15
@uvelichitel

Of course it's possible. There are such applications https://play.google.com/store/apps/details?id=com.... Within the line of sight, you do not need a third-party network at all - wifi spot can be set up on the device. If you wish via intra/internet, then servis_disvovery and name_resolving are performed by means of the provider google/apple/MTS etc. Servers on android are raised, as on any linux, personally verified.

S
StrangeAttractor, 2015-12-15
@StrangeAttractor

Of course you can. I don't see any problem. Unless it will work either only within one local network (for example, sitting at home with a guest / neighbor on the same WiFi or, say, on a train, setting up your smart as a shootout point - by the way, it should be very convenient for multiplayer toys without the Internet, I would like it to be more such) or in the conditions of port forwarding prescribed on the router.
PS: I recommend that you immediately embed in your application the display of your own IP, which you need to inform the client, otherwise I personally, for example, did not find a standard function (in the sense not in the SDK, but in the Android UI itself) or at least one convenient application that does this .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question