metawatch

Sending data via Bluetooth with Android

旧巷老猫 提交于 2019-12-21 06:17:15
问题 Ive written code that connects and sends data from an Android device to another via Bluetooth. It all works when run from that class. When I create an instance of the class the data gets sent to the output stream before the connection creation has finished. How do I check that the connection is up before sending data? package com.flightscope.app.metawatch; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException;

Sending data via Bluetooth with Android

自古美人都是妖i 提交于 2019-12-21 06:17:01
问题 Ive written code that connects and sends data from an Android device to another via Bluetooth. It all works when run from that class. When I create an instance of the class the data gets sent to the output stream before the connection creation has finished. How do I check that the connection is up before sending data? package com.flightscope.app.metawatch; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException;

Sending data via Bluetooth with Android

和自甴很熟 提交于 2019-12-03 20:57:57
Ive written code that connects and sends data from an Android device to another via Bluetooth. It all works when run from that class. When I create an instance of the class the data gets sent to the output stream before the connection creation has finished. How do I check that the connection is up before sending data? package com.flightscope.app.metawatch; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import com.flightscope.app.metawatch.Crc; import android.bluetooth