两个使用无线上网的Andr​​oid之间传送数据 [英] Transfer data between two Android using Wifi

查看:156
本文介绍了两个使用无线上网的Andr​​oid之间传送数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想开发一个Android应用程序,它必须能够传输数据/消息两款Android手机之间,如使用自己的无线客户端 - 服务器连接,无网络或路由器附近。我只是想用技术合作计划这样做,但它没有,它不连接,我得到的ConnectException,并拒绝连接。

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.

是否有可能实现这一目标采用Android便携式热点集成了应用程序?有没有关于这种方法的任何教程?

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.

推荐答案

您需要获取联网到对方的两个设备之前,你可以不用担心该网络连接的TCP使用。

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

如果一台设备是愿意履行接入点一样的功能作为一个便携式热点的一部分,你选择作为另一条wirelss网络,您可以实现两者之间的网络连接,可用于定制业务。虽然有办法的热点可以实现,其中,将无法正常工作。另外值得关注的,客户机的设备现在可以通过热点设备将所有的网络流量,不仅包括前台的应用程序,但它的任何决定做背景。

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.

这篇关于两个使用无线上网的Andr​​oid之间传送数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆