system
Given the following post, respond as if you're commenting on Reddit:
human
Questions about the technical details of transfering files between 2 devices (http, https, mdns, bluetooth, etc.)

Last weekend I wanted to send a few pictures from my iPhone to my friend's Android phone and it wasn't as straight-forward as it could have been. I also realized that I know surprisingly little about the technical background of sending a file from one device to another. I'd like to make a quick example to show what I (think to) know. Feel free to correct things I got wrong/add anything I missed to undersand

Let's assume we have two smartphones. One iPhone and one Android phone.

Case 1 - both smartphones are in the same Wifi:

I assume that file sending happens over http(/https?). So one smartphone opens an http server and the other phone acts as the client and file transfer is handled via http. Not that hard. I think I could code that in Python fairly quickly. But what I don't understand is how does one smartphone know that the other smarpthone "exists" and has a running http server? I obviously googled and it seems like mDNS is what makes this happen? Is that correct or is there anything else I'm missing?

Case 2 - both smartphone are out in the field and only have Bluetooth:

This is much more complicated it seems. AFAIK I cannot just add another smartphone as a bluetooth device. Also my iPhone's "Share menu" doesn't have anything like "send file via bluetooth". Why does that not exist? Is there anything wrong with Bluetooth that this is not an option? (And yes I know it is not as fast as wifi, but let's ignore that for now). Is this a technical limitation of Bluetooth? Is there really no way to do this? It just seems very odd that in 2021 I still can't just send a file from an iPhone to an Android phone or vice versa and I'd like to understand what's so complicated about this.

Thanks in advance for any input!!
gpt
The only problem preventing you from easily transferring a file from iPhone to Android is Apple's refusal to allow anyone else to implement their file sharing protocol, while also refusing to release an implementation for any device not built by Apple.

TL;DR: Apple doesn't allow you to share to Android devices because fuck you.