English 中文(简体)
1. 装有青to装置的自动电离层
原标题:Auto-Connectivity with Bluetooth Device to Android Phone

I am using a Bluetooth device to connect with the android Phone manually there is no problem. But My Question is how can I connect automatically when I starts my Activity or Application .
I am taking the reference of Bluetooth chat in Sample API to connect. http://developer.android.com/resources/samples/BluetoothChat/index.html

请建议我。

最佳回答

是的,你可以使用蓝色波照相机实现这一目标。 首先,你们都需要找到这种装置。 现在,你需要使这一条硬性编码(静态)连接起来。 您可在网上查阅。 自动连接活动方法。

问题回答

By the default API example, I get the same problem : when connecting each other more 5 seconds, it will lost automatically However, finally, I found that I put a finish() in the onCreate() method for debugging. when I take it off, it works fine all the time that sending data to the bluetooth chat demo.

它不需要发现。 并且如果能够第一次、今后再分配,它只会直接发送。

最重要的法典如下:

mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
    BluetoothDevice device = mBluetoothAdapter
            .getRemoteDevice("6C:83:36:A0:0E:89");

    new ConnectThread(device).start();

ConnectThread can be found in the Android Demo API: http://developer.android.com/guide/topics/connectivity/bluetooth.html





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签