0

I want to stream data from my Laptop PC to my Android phone using TCP or UDP by creating sockets in both the phone and the laptop, but it has to be done wirelessly. How do I connect them to stream the data ? I thought creating an ad-hoc wireless network from my laptop and connecting to it using my Android would work. But my Android is not detecting the ad-hoc network.

Is there any other way how I can connect the two ? I downloaded this software called 'connectify' and created a wifi hotspot on my laptop, and successfully connected the two. But will I be able to stream data to my device using this connection ?

Can simple direct Bluetooth connection help me in creating sockets in both phone and laptop and stream the data ?

5
  • Is your phone capable of tethering? My Samsung Galaxy S2 is, which makes it possible for my laptop to use a local private wireless network that the phone provides. So the phone and laptop can access the internet, and then can use sockets to send information between the two. Jun 7, 2012 at 15:07
  • Do you mean real-time data streaming (as in video or audio) or something that is not real-time?
    – jhonkola
    Jun 7, 2012 at 16:53
  • No, I dont think so. I have a HTC Desire S, with GingerBread. And I want to transfer data real time.. like a video or audio.
    – Deepun
    Jun 8, 2012 at 16:24
  • If this is your phone you can definitively try taking the advantage of DLNA.
    – Darius
    Nov 16, 2012 at 16:40
  • If you want to stream from phone to laptop you will need DLNA server on your phone and DLNA client on the laptop. Some Android video players like VPlayer Video Player have the client built in so if you have the server on your laptop you should be able to find it and play it.
    – Darius
    Nov 16, 2012 at 16:46

6 Answers 6

2

You could try to use an ftp program and run your android phone as a ftp file server that will work also. for what your tyring to do. I am assuming your trying to transfer files.

0

Newer phones include options for directly connecting devices via Wi-Fi, e.g. Wi-Fi direct, but you can't count on this.

Yes, you could use the Wi-Fi hotspot feature of stock Android to create a hotspot on the phone and have the laptop connect to it, but many phones don't have the hotspot feature (the carriers don't like it).

In many situations (e.g. people's homes or offices) the laptop and the phone will already be connected to the same local network via a Wi-Fi access point. In this case you can use sockets (as you mention) to create a connection between the two devices, and this allows them to remain connected to the access point so e.g. the laptop doesn't lose its Internet access while it is using your app.

I would suggest that both sides listen on a socket (ServerSocket), while simultaneously trying to connect to the other's side's listening socket. There is lots of information already available about the details of implementing this.

Yes, Bluetooth could be a great solution too: it allows for direct comm between the two devices and doesn't interfere with whatever the device's are using Wi-Fi for (e.g. connecting to the Internet). However, I'm writing an Android Bluetooth app now and am quite struck by the number of bugs. I guess Bluetooth isn't used very much so they don't test it very much. For this reason I would suggest sticking to regular Wi-Fi networking instead.

1
  • Thank you very much. I found a way around right now, hope that it works. I used the software "Connectify" to create a Wifi Hot Spot on my laptop, and my Android is able to detect and connect to the Laptop via this network. Although i havent tried sending data. But hopefully it will work.
    – Deepun
    Jun 8, 2012 at 16:26
0

Your Android & PC must have an App installed called AllShare, and both must be connected to the same network (other options are also available but I haven't tested them). Once connected, you can explore all your Android videos, photos, and music on the laptop wirelessly.

1
  • Well, any DLNA software/app will work. Some are better than others.
    – Darius
    Nov 16, 2012 at 16:41
0

I assume you connect both devices to a wifi router. Then I would use the app ftpserver. For me that works best to transfer files, small and large. Sometimes I need SSH, for rsync, and then I use sshdroid on the phone.

0

Try soundwire along with unified remote.

Ps- You will need the app both on the laptop and phone. And regarding the "no internet connection" thing, create a WiFi hotspot using your phone and then search from your laptop for the hotspot and then connect.

I would be happy to elaborate if you don't understand.

-1

AFAIK Android does not support ad-hoc networking (my 2.3.3 certainly doesn't). That might be the reason why you couldn't connect. But some devices (again, mine) can serve as WiFi Hotspots, so you can connect PC to it. If not, you can buy a used WiFi router and connect both devices through it.

Bluetooth should also work, the Android demo application provided with the SDK has all the information you need.

1
  • Thank you very much. I found a way around right now, hope that it works. I used the software "Connectify" to create a Wifi Hot Spot on my laptop, and my Android is able to detect and connect to the Laptop via this network. Although i havent tried sending data. But hopefully it will work.
    – Deepun
    Jun 8, 2012 at 16:27

You must log in to answer this question.