Answer the question
In order to leave comments, you need to log in
How to exchange messages via bluetooth in android application?
Hey!
I'm making an android app that needs to exchange messages with another (existing) bluetooth app (I've never done this before). Based on examples from the Internet, the code turned out:
while (socket == null) {
try {
serverSocket = BluetoothAdapter.getDefaultAdapter().listenUsingRfcommWithServiceRecord(
APP_NAME, UUID.fromString(UUID_STR)
);
socket = serverSocket.accept();
} catch (IOException ex) {
ex.printStackTrace();
}
}
accept
and throws an exception from time to time. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question