All numeric representations on a digital computer are binary representations, so converting from float to binary makes no real sense. A float is however a multi-byte representation, so to send it over RS-232 it must be split into bytes. That is a simple case of casting and indexing:
int send_float( float x )
{
char* c = (char*)&x ;
for( int i = 0; i < sizeof(float); i++ )
{
send_byte( c[i] ) ;
}
}
However, that is probably not wise - the binary representation of float and byte order on the receiving platform may differ from that of the transmitting station, so it is generally better to convert the float to ASCII and sent a string:
int send_float( float x )
{
char a[32] ;
int length = sprintf( a, "%f", x ) ;
for( int i = 0; i < length; i++ )
{
send_byte( c[i] ) ;
}
}
With respect to applying start and stop bits, these are applies to the individual bytes independently of the data content, so adding them to the float value makes no sense either. The start/stop bits are added by the UART hardware. While it is possible to bit-bang an asynchronous serial transmission in software, you would not do that in Java and in any case to ensure the critically accurate timing on Android, it would require a kernel level interrupt driven driver and would impose a disproportionately high CPU load.