1. Are you ready for the Galaxy S20? Here is everything we know so far!

Android App Detect when two phones touch

Discussion in 'Android Development' started by Daniel Pedersen, Aug 9, 2020.

  1. Daniel Pedersen

    Thread Starter

    So I am making an app which needs to detect when two phones are close (1-2meters or less) and transmit some small amount of information (some strings and such).

    I have been looking at the Google Nearby Connections API. But i cant limit that to just work when the phones are within 1-2 meters. And it also drains a lot of battery and both of the phones need to both Advertise and Discover at once.

    Does anybody here know how I could do it? Something like NFC, Bluetooth Low Energy or??
     


    Tharpebb63 likes this.
  2. mikedt

    mikedt 你好

    I'm not a dev of course, but I know with NFC the phones do have to pretty much touch each other, to exchange data, like 1-2cm. Also not all devices have NFC. So Bluetooth Low Energy (BLE) is what you have to use?
     
  3. Daniel Pedersen

    Thread Starter

    So to be honest, I would use either one of those methods if just I could find how to it. with some examples
     
  4. mikedt

    mikedt 你好

    As I said, I'm not a dev, so can't really help you with that. Somebody else may know more.
     
Loading...

Share This Page

Loading...