Scott Mitchell
Scott Mitchell

Reputation: 11

How to play/stream audio files from multiple android devices?

So basically my first question is:

1) Is it possible from, say my phone (an android), to access music on another android phone and play it on my phone?

I first looked at this question and then looked into BluetoothA2dp but I didn't really understand how it worked and I also read it only allows a connection to one device at a time.

I also looked at Bluetooth sockets, but from looking at both A2dp & sockets it seems bluetooth could only really transfer files between two phones and not really "browse"/stream files. (correct me if I'm wrong).

From there I came across into WiFi P2P, which seemed to be exactly what I was looking for since it has a multiple client to server relationship. Even with this I'm still stuck on how to access music files on the other device (without transferring them) using either bluetooth or WiFi P2P.

I also thought I might need to set up an http/ftp server on the phone in order to access files, though I would prefer to not have to do that.

So my second question:

2) If the first question is possible, how could I extend it to using multiple devices?

Maybe using WiFi P2P?

I haven't started the app yet but I did manage to make a small program that pairs two devices via bluetooth.

Any help or explanation is appreciated!

Upvotes: 1

Views: 1400

Answers (1)

GiapLee
GiapLee

Reputation: 436

you can use this lib to make android phone become a http webserver where you can public any mp3 file url (ex. http://192.168.1.100/mp3s/hello.mp3) and other android phone can connect end play that url

Can read and try this lib on git nanohttpd

Upvotes: 0

Related Questions