connectivity-samples icon indicating copy to clipboard operation
connectivity-samples copied to clipboard

Nearby API Transferring files at Bluetooth Speed.

Open UttamPanchasara opened this issue 7 years ago • 6 comments

I have tried to transferred file using the Nearby API it works fine but the problem is that it transferring file at Bluetooth speed, as I read in Google doc that the API uses a combination of Bluetooth, BLE, and Wifi hotspots, and as it's provide P2P connection it should transfer file over WIFI with high speed.

Tested on Nexus 5 with MI Note 4 and my both devices on same network but not able to get high data transfer speed, is there anything else that i have to do to get high data transfer speed ?

Used Google play service : compile 'com.google.android.gms:play-services-nearby:11.0.1'

also it automatically create wifi hostpot on sender device while start advertise and sometimes receiver device gets connected to same network during file transfer but file only transfer with bluetooth data transfer speed, have tried by sending 5-10MB of files. Any solution on this ?

UttamPanchasara avatar Jul 19 '17 07:07 UttamPanchasara

Thanks for trying out the new offline version of Nearby Connections, Uttam!

We don't currently take advantage of the fact that both your devices are on the same network (but we're working on it for an upcoming release), so the maximum speed you can expect to get is from the advertiser starting a Wifi hotspot, and the discoverer successfully connecting to that hotspot -- in that case, you should get speeds of 1-3 MB/sec.

For reference, Bluetooth speeds are ~150 KB/sec. Is that what you're seeing?

It's possible that there's either a failure to create the hotspot, or to join the hotspot, so could you try to reverse the roles and see if that helps improve things? I would expect more success if you tried making the Nexus 5 the advertiser (so the hotspot starts there) -- from our experience, Xiaomi phones end up having more restrictions than normal around programmatically using Wifi hotspots.

reznor avatar Jul 19 '17 09:07 reznor

@reznor Varun Kapoor Thanks for your response,

I already tried by making Nexus 5 as advertiser but no luck sometimes receiver device got connected with hostpot, In MI Note 4 device it shows dialog to enter WiFi password while connecting to hostpot with no security, getting strange behavior!!,

Hope this will be fixed in upcoming release.

Yes, you are right, Xiaomi phones having more restrictions than other devices and may be that's only problem, because recently i tried same on Samsung Tab with Nexus 5 it's working better and getting more transfer speed than MI device but still it takes more time for first time.

UttamPanchasara avatar Jul 19 '17 11:07 UttamPanchasara

Hi @reznor, Any updates on this? Thanks

chirantan31 avatar Jan 09 '18 19:01 chirantan31

One suggestion I got from the devs was to use P2P_STAR instead of P2P_CLUSTER if you want to take advantage of WiFi speeds. P2P_CLUSTER exclusively uses Bluetooth, and P2P_STAR will attempt to upgrade the connection to WiFi Direct/Hotspot if possible. Otherwise it will fall back to Bluetooth.

shortstheory avatar Feb 21 '18 21:02 shortstheory

I am also facing the same issue even with P2P_STAR topology. The transfer always happens at bluetooth speed between my Lenovo K6 Power and Motorola E2.

ankitbatra11 avatar Oct 21 '18 23:10 ankitbatra11

This also occurs even when using the P2P_POINT_TO_POINT topology, especially with Samsung devices & some time on any device. Any update on this issue.

deepakkumardk avatar Jul 20 '20 15:07 deepakkumardk