0

My project was to create an application like AirDrop of Apple. To do so, I need to create an specific network for my application so that only my application can pick this network and I have to do it with Java. To my knowledge, Java does not have a wifi library. So what is my option here for my project?

I cannot use Ethernet connection. I have to use a network something like bluetooth which will find only the existing application in the network.

I am sorry if I missed anything. I am not too good with networking as well.

Aziz Shaikh
  • 16,245
  • 11
  • 62
  • 79
  • Your question doesn't make any sense. An Ethernet connection and a WiFi connection are effectively identical to a user level process like the JVM. It sounds like you want send a "broadcast" packet, and "discover" other hosts on your network. – Elliott Frisch Dec 29 '13 at 06:36
  • Sounds more like a client/server application that requires the ability to detect and query network devices via wifi/bluetooth. You're creating a virtual network, but not a physical one, so the question is misleading. – blackcompe Dec 29 '13 at 06:37
  • @ElliottFrisch cannot use Ethernet connection. –  Dec 29 '13 at 06:47
  • @blackcompe Yes it is a client-server application. I actually do not know about anything on networking. sorry. sorry, how should I create a virtual network like bluetooth? –  Dec 29 '13 at 06:49
  • Bluetooth is a wireless technology. You create the virtual network atop it. imgx64 told you that AirDrop uses multicast DNS as its underlying technology. That's all you need to know. The rest is up to you. You can use JmDNS or you can roll out your own solution. If you're still lost, you need to do some reading. – blackcompe Dec 29 '13 at 06:54

1 Answers1

4

AirDrop for Mac OS X basically uses mDNS to discover other computers on the same network that also have AirDrop running, then uses regular TCP/IP connections to transfer the files. This means you don't have to create "a specific network for your application".

There's an mDNS library for Java called JmDNS.

For general information about networking in Java, I recommend this trail from the Oracle Java Tutorial (the All About Sockets section to be more specific).

Also note that AirDrop for iOS uses a different method involving Bluetooth and WiFi, which is different from AirDrop for Mac OS X.

Addendum: Looks like AirDrop also uses some WiFi-chipset-specific features to create an Ad-Hoc network simultaneously with the current network connection. Creating Ad-Hoc networks is dependent on the operating system and is really out of the scope of a Java program. See also: this, this and this.

However, this shouldn't stop you from trying the mDNS approach, as long as the computers are connected to the same network.

Community
  • 1
  • 1
imgx64
  • 4,062
  • 5
  • 28
  • 44