I made a program which allows users to send texts between two mobile phones, the phones are connected via bluetooth. I tested it but there was a problem, from the error i got i could tell that it was trying to send something but couldn't. Can someone look at this code, i think the most likely problem is the segment of text, that represents the address thats being connected to. Or the Uuids for the Write and Read Strings blocks, But im not really sure.
I've provided some comments from my program, to help explain what im doing.
Comment for "when Connect Touchdown": when connect is clicked start scanning for available connections. Set the elements of the list to be addresses of devices that are able to connect. In 600 seconds if no connection is made then stopping scanning, show the alert "Device not connected" and disable the stopScanning timer.
Comment for "when BluetoothLE1 DeviceFound": When a connection has been found, connect to the address that has been selected. Disable the stopscanning timer, and display the message "Device connected".
Comment for "when send Click": When send is clicked, find the service Uuid for this service. Find the CharacteristicUuid for the connected device. Set the encoding to UTF-16. Send the text in the textbox named "data" to the connected device.
Comment for "when BluetoothLE1 StringsRecieved": When the connected device has recieved strings from another device, read them, and set the text property of the textbox called data to those strings.
Comment for "when stopScanning Timer": After 10 minutes (600 seconds) if no connection has been found, stop scanning for connections, show the alert "Device not connected", and disable stopScanning.
program file:the_app.aia (142.7 KB)
My phone is on Android version 8.1.0