-2

I am working on a personal project where by I would like to create something like a radar displaying the devices around me that are wifi direct enabled. The devices detected should be displayed on the radar view relative to my devices position (which would act as the center of the view).

I cannot find anything in the API's that allows me to do this and could use an example, failing that at least a push in the right direction to get started.

TomTaila
  • 1,694
  • 1
  • 20
  • 33
  • Are you talking about any devices or specific devices? The only "maybe" possible way would be to install a service on each device that would allow other devices to detect them, but that goes against privacy... maybe another way would be to modify your router to let a specific device know about devices connected to that router. Of course, it is not possible to simply send a message over the air asking other "wifi enabled" devices to reply with their position. – Über Lem Dec 28 '14 at 06:13

1 Answers1

1

I think you could do it using the technique outline here in the Android docs. (I'm now experimenting with it, but for different purposes). Basically, this lets devices broadcast and discover DNS-SD TXT records. As you'll see in the Android docs, you can load a Map object into one of these records and the receiving device can read it. It doesn't support a lot of bytes (I was trying to jam in an image converted to Base64 strings and that was way too much data), but it would support strings for latitude and longitude. Users would need to install your app on both sides for it to work, of course. Interactions can be passive until such time as you need to trade larger amounts of data, at which time a socket needs to be setup, etc., which requires the user to click to accept via a popup dialog.

If you copy/paste their sample code, it will pretty much get you going with something you can build on.

JASON G PETERSON
  • 2,193
  • 1
  • 18
  • 19