This is the same Bluetooth chat app from Android samples, but little bit modified to receive bluetooth connection using services. The code allowes incoming connection sending test data to the bluetooth chat.
The code currently works fine with the Raspberry pi running Raspbian with bluetooth library using RFCOMM communication.
Other part of the code can be found in my other repository "BluetoothPython/client1.py"
Android app and python script running on Raspberry pi share common uuid.