简体   繁体   中英

Two way communication between Android and PC

I am working on an Android application which is making real time communication between Android device and PC. I want to record audio signal and then send it to a server where it will be save to .wav file online.

By now I made an application which is streaming audio and playing it, but I want to save that bytes to a file on the computer. The problem is that, can I send command from server which firstly starts an streaming applcation on Android and then send command which stops receiving bytes? It will allows me to get array with bytes, which can be save to .wav file. I'm using TCP protocol.

You may use a socket connection between you computer and the mobile device that the PC may use to notify that the android should start streaming (or even transfer the bytes stream through it).

There is a bunch of libraries (on both client and server side) that implements socket communication. Two big player there are:

SignalR

Socket.io

You may also use the Android Socket API to implement that (if you don't want to use a third party library)

Socket - Android Developers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM