how to send sensed data in onSensorChanged method over bluetooth in android?
<p>Please help me i am stuck in between my dream project. Here I am sensing the data in onSensorChanged method &amp; trying to send the data to PC over bluetooth. But i am unable to make that work.Here are</p>

<pre><code>public void onSensorChanged(SensorEvent event)
{
    // TODO Auto-generated method stub
    float flt = event.values[1];
    buf = (int)flt;
    String msg1 = Integer.toString(buf);
    myLabel.setText(msg1);
    sendData();

}

void sendData() throws IOException
{

    Log.v(TAG, "in send data...");
    String msg = Integer.toString(buf);
    msg += "\n";

mmOutputStream.write(msg.getBytes());

    myLabel.setText("Data Sent");


}
</code></pre>

<p>I have made buf global.</p>
