DEV Community

Cover image for life [2] - I want to build a file sharing app
Fadhil ⚡
Fadhil ⚡

Posted on

life [2] - I want to build a file sharing app

This is a series where I update about my daily life. The company I work for don't have any new clients, so no projects to work on. I'am planning to leave this company anyway (If you are recruiter and want to hire me shoot me an email fadhilsaheer@gmail.com), so I wanted to build something which can catch recruiter's eyes and develop my skills.

This blog post is the understanding I have on the mentioned technologies, there might be a lot of corrections to be made, feel free to mention it in comments, it would help me a lot

I want to build a file sharing app 📂

Context

I had this idea for a while to create an app which can share files similar like Xender, airdrop etc. But with back to back compatibility with all devices. I thought there would be similar api for the tech, but I was wrong 🏃

My research

There are different ways you can share files between devices like

  • Connect devices over wifi
  • With bluetooth etc, but every one of them comes with a draw back, sending files over wifi is fast, but both devices have to be in same network. Connecting devices between bluetooth is easy and fast, but sending files between is too slow.

Many of the existing softwares use bluetooth for discovering and connecting and send files over wifi.

This is what I thought initially, but It was kind of hard. there are different tech kind of technologies and protocol to be mind of

My initial thought was to create a hotspot and connect to that hotspot using another device and make a webserver run on hotspot device and send files using HTTP.

Even though thats a solution, whats the fun in that ? I wanted to push pass my limits anyway.

So I created a simple prototype using NFC (Near field communication), there is a library called libnfc, There is rust crate which had binding for libnfc, so I used it to create a basic discovery and device connection, but sending files with it is impossible, its too slow, and range between device is 4-10 cm. And transfer rate is only upto 424 kbit/s even bluetooth's transmission rate is about 1 Mbps, and it is enhanced upto 24 Mbps in BLE (Bluetooth low-energy).

My next option was to use Wi-Fi Aware & Wi-Fi Direct, which have support on android, windows and linux. But apple doesn't support it. To be exact apple have another tech called Apple Wireless Direct Link (AWDL) which they use for airdrop, to share device state between apple device etc. So they dont have support for other tech, to be exact they don't support Peer to Peer data support with other devices like wi-fi direct does (At least this is what I learned of)

So now what ?

Fortunately I found a reddit post which mentioned about a software named Flying Carpet after tinkering with that, and checking its code I found out there is something call Wireless ad hoc network (WANET), it its basically a decentralised type of wireless network which does not rely on router or wireless access points.

Flying Carpet use ad hoc wi-fi to share file. Basically it create an Ad hoc network in a device and other devices need to manually connect to that Ad hoc network.

I'm planning to use NFC to connect and discover devices (it is the only thing apple and others have in common). Any one of the connected device would create an ad hoc network and other device will connect it to automatically using NFC.

This is basically hypothesis, not sure If it'll work the way I expect it to, or to be exact I'm not even sure if it can be achieved this way

Conclusion

Either way I want to build this app, If they can do it, why can't I ?. This blog post might not be correct, I'll update it if I find corrections. This is what I understood from learning and researching about this for the past few days.

I'll update the progress in coming posts, wish me luck!

Top comments (0)