android - How can two machines detect each other when their ips keep changing? -


let me describe want achieve , stuck. okay suggest entirely different alternative.

  1. i have android phone nfc feature.
  2. i have macbook pro.
  3. a wifi network.

whenever tap phone on nfc tag want macbook run script.

so did following

  1. an android application invoked whenever device senses particular nfc tag.
  2. my macbook runs nodejs http server
  3. android app sends http request nodejs, nodejs invokes whatever script wanted run.

this setup works @ home can set ip address of macbook whatever want. want same setup work transparently when in starbucks (or workplace) , both android , macbook on same wifi network. (i dont want enter ip addresses manually).

when halfway through realized have used bluetooth feature on macbook have write sophisticated program on macbook listen android device , accept commands.

on android, use network service discovery. if you're using earlier target, jmdns friend. have used allow android devices find each other, should compatible bonjour service on mac.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -