Sending text to Android using Bluetooth

Hello guys,

I have a final project to make communication between arduino to android.
For example, in arduino my Ultrasonic give result such as "Range is 1.84 m".
In my android, i have coded a simple text to speech to transform a text to speech.

So the question, how to send "Range is 1.84 m" to my android using Bluetooth and how to make android receive the text what arduino send ?

btw, i have found a clue from this link

@sarouje said i can send the string after put this code

void sendAck(String toSend){
char payload[toSend.length()+1];
result.toCharArray(payload, sizeof(payload));
Serial.write((uint8_t *)payload,sizeof(payload));
}

now, i am confused on android part. I don't understand how to make android receive the message.

Thank you

So the question, how to send "Range is 1.84 m" to my android using Bluetooth

Without knowing how YOU connected the bluetooth device to the Arduino, we can't tell you that.

The bluetooth device is almost certainly a serial device, so some form of Serial.print() IS the answer.

Do you have simple source code that communicate or aend text from arduino to android using bluetooth ?
I found tutorial and .apk generated using App Inverter...
I need the source code, so i can understand the process and i can put my own to my textto speech :slight_smile:

Do you have simple source code that communicate or aend text from arduino to android using bluetooth ?

I already told you. Serial.print(), or the SoftwareSerial equivalent, is what you need to send data to the bluetooth device, depending on how you connected the bluetooth device, which, despite being asked, you refused to reveal.

kuxsux:
I need the source code, so i can understand the process and i can put my own to my textto speech :slight_smile:

Here we go, this sends “Hello World” to an Android device from an Arduino. Use something like Blueterm on the Android to read the text coming from the Androids Bluetooth device.

#include <SendOnlySoftwareSerial.h>
SendOnlySoftwareSerial Bluetooth (TXpin);        //specify the Tx pin

void loop()
{
  Bluetooth.println("Hello World");
  delay(1000);
}

void setup()
{
  Bluetooth.begin(9600);                      
}

Thanks mate, wanna try and give you some feedback or questions hehe...

kuxsux:
Thanks mate, wanna try and give you some feedback or questions hehe…

To answer your PM, no I dont have ‘source code’ for an Android application, perhaps better to ask that question in a forum that supports the Android platform …

These two blog posts may give you ideas: