0

I am making an app that requires bluetooth server communication. I am trying to set it up so that I don't have to use a UUID to find my device's bluetooth server port. Whenever I use the UUID to find the port of my phone's bluetooth server on my PC, it returns 8. I am considering hard coding this port in, but I am unsure if it is app specific, phone specific, or if it is the port that BluetoothServerSocket will always use on every phone. Would someone be able to clarify this for me?

Chris Ray
  • 133
  • 1
  • 2
  • 8
  • Do this help? https://stackoverflow.com/questions/9703779/connecting-to-a-specific-bluetooth-port-on-a-bluetooth-device-using-android – Shailesh Suryawanshi Jul 21 '21 at 16:33
  • @ShaileshSuryawanshi Thank you for your response, but it does not help. In that example they are connecting to a bluetooth server via the UUID of the server. In my code, it is the other way around. I am using BluetoothAdapter.listenUsingRfcommWithServiceRecord to create a server on the phone, which then listens for connections from a computer. I do it this way since it is the only way I can find that allows me to not need a UUID. – Chris Ray Jul 21 '21 at 17:55

0 Answers0