问题描述
我想建立一个移动设备与计算机之间的连接,这样他们可以与彼此交互。我应该能够在两端发送和接收数据,就像一个聊天客户端。我怎么做呢?我只是想知道涉及的步骤。我在想从设备发送数据到数据库服务器,然后通过PC访问它,做同样的移动设备上了。这是一个好主意?什么替代品呢?
I would like to establish a connection between a mobile device and computer so they can interact with each other. I should be able to send and receive data at both the ends, just like a chat client. How do I go about it? I just want to know the steps involved. I was thinking about sending the data from the device to a database server and then accessing it through the PC, and doing the same on the mobile device, too. Is this a good idea? What alternatives are there?
推荐答案
由于您使用的Android,这是pretty容易。一个简单的选择是code为Android设备和PC客户端和服务器应用程序。或者,你可以只发送UDP的连接协议的数据。
Since you're using android, this is pretty easy. One easy option is to code a client and server application for your android device and pc. Or, you could just send data on the UDP connectionless protocol.
我假设你知道如何。没有必要的中间节点(一个数据库服务器等),如果这里的目标是小到刚刚发送数据来回
I'm assuming you know how to build apps for an android phone. There is no need of an intermediate node (a database server or the like), if the goal here is as small as just sending data back and forth.
是一个很好的例子一个UDP服务器/客户端的实现。
和是一个很好的一个TCP服务器/客户端。
Here's a good example of a UDP server/client implementation.And here's a good one for TCP server/client.
希望有所帮助。
这篇关于之间的移动设备和PC的无线连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!