So here's the premise: you have a large file, let's say it's at least 250MB. You need to get it from one computer to another. It can be a large document, some photos or videos, a program, or something else. You try looking for a USB flash drive -- but you can't one. You try emailing it to yourself, but everyone else is quarantined and on video calls, so your internet's really slow. You try finding a USB drive, and you do! You transfer the files onto the drive, bring it over to your other computer, and -- it only has USB-C.

What it does

Luckily, LANShare is here to help! With LANShare, you can transfer files quickly over your local internet! Since all of the traffic is contained within your home network, it's super fast, secure, and private -- no more giving Google or Yahoo your sensitive informatoin! It works on Windows, Mac, and Linux, and all you need is an internet connection! It's super light-weight and can run on virtually any modern computer.

How I built it

UI: I used OpenJFX, or the open source spinoff of JavaFX, to build the UI. For theming, I used JFoenix, which gives the program a nice material design theme. I also added in some animations to transition between the screens. I'm personally really proud!

Networking: This program is both the client and the server. It runs directly on top of TCP and UDP, allowing for greater performance. The client, or receiver, sends a UDP broadcast so that all other devices running the program know that it's ready to receive files. Then, the other programs send a message back so the client knows which devices it can receive files from. This is all done using a custom UDP protocol I designed based on SMTP. When the sending device wants to send a file to a receiving device, it'll establish a TCP connection and read the binary data of the file. This gets sent over to the receiving end, which writes the binary data. When the transfer is complete, the connection closes.

All of the networking is done using Java's TCP and UDP APIs, and I also added in error checking in case anything goes wrong. The file reading is also done using Java's file IO libraries.

Challenges I ran into

This was my first time dealing with TCP and UDP in general let alone with Java. I had to both apply the stuff I learned from my networking class and learn more (e.g. UDP broadcast signals) to get this thing to work.

It was also my first time using JavaFX and JFoenix, so I had a lot of trouble with that. I had to redo the UI two or three times, but eventually, I got something I really liked!

Accomplishments that I'm proud of

I'm incredibly proud of the UI -- I think it looks really nice, and the transitions are smooth. I'm also proud of the fact that I was able to write a TCP/UDP application.

What I learned

I learned how to use TCP and UDP as well as how to design a UI.

What's next for LANShare

I think this is incredibly valuable, and I really want to spread the word so more people can use it.

Built With

Share this project: