Vignesh
Vignesh

Reputation: 3601

Transfer data between two Android using Wifi

I'm trying to develop an Android application which have to be able to transfer data/message between two Android mobiles, as a client server connection using their own Wifi, which having no network or routers nearby. I just tried using Tcp program to do this but it fails, its not connecting, I'm getting ConnectException and connection refused.

[Edited] Is it possible to achieve this using Android Portable Hotspot integrated with application? Is there any tutorial regarding this approach?

Any Ideas, how to do this? Thanks.

Upvotes: 0

Views: 3764

Answers (1)

Chris Stratton
Chris Stratton

Reputation: 40357

You need to get the two devices networked to each other before you can worry about tcp usage of that network connection.

If one device is willing to perform access-point like functionality as part of a portable hotspot, and you select that as a wirelss network on the other, you may achieve a network connection between the two that can be used for custom traffic. Though there are ways the hotspot could be implemented where that would not work. Also of concern, the "client" device will now be sending all of its network traffic through the hotspot device, including not just foreground apps but anything it decides to do in the background.

Upvotes: 1

Related Questions