文件名称:BluetoothChat
介绍说明--下载内容来自于网络,使用问题请自行百度
這一節的說明主要是針對 Linux 的環境,或者更嚴格的說是我還沒有發現 Blue Cove 以前的測試環境。現在 Windows XP SP2 之後已經支援藍芽的驅動程式,再加上 Blue Cove 以及藍芽設備,你就可以開始開發了。不過,我還是把以下的說明留下來當參考用。
兩部安裝了 Linux 的電腦,請確定這個版本的 Linux 內建支援 BlueZ。我們用的是 Fedora Core 1,你也可以參考 窮人的 Java Bluetooth 開發環境之建置 來建置你的開發環境。
依照 BlueZ 硬體相容清單 去採購你的藍芽裝置. 我用的是別人幫我買的 X-Micro 的 Bluetooth USB Dongle. 雖然這個設備並未出現在相容清單內,但是目前為止使用上都還蠻順利的。你可以在環境架好了以後,再去購買,如果發現不相容可以馬上退貨。
Linux 環境安裝有 J2SDK 1.4.x (or later) 以及 Rococo Software s Impronto Developer Kit for Linux.
安裝至少 bluez-libs 和 bluez-utils 套件。
請在兩部電腦上都利用以下指令來確定你的環境是正確的(# 為註解) -import java.io.*
import javax.bluetooth.*
public class LocalInfo
{
public static void main(String args[]) throws BluetoothStateException {
LocalDevice localdev = null
try {
localdev = LocalDevice.getLocalDevice()
} catch (BluetoothStateException e) {
System.out.println("ERROR: cannot access local device")
System.exit(1)
}
System.out.println("a local bluetooth device is found:")
System.out.println(" Name: "+ localdev.getFriendlyName())
System.out.println("Address: "+ localdev.getBluetoothAddress())
System.out.println("\nIts device classes are:")
DeviceClass devcla = localdev.getDeviceClass()
System.out.println(devcla.toString())
System.out.println("Service Class: "+ devcla.getServiceClasses())
System.out.println("Major Device Class: "+ devcla.getMajorDeviceClass())
System.out.println("Minor Device Class: "+ devcla.getMinorDeviceClass())
}
}
兩部安裝了 Linux 的電腦,請確定這個版本的 Linux 內建支援 BlueZ。我們用的是 Fedora Core 1,你也可以參考 窮人的 Java Bluetooth 開發環境之建置 來建置你的開發環境。
依照 BlueZ 硬體相容清單 去採購你的藍芽裝置. 我用的是別人幫我買的 X-Micro 的 Bluetooth USB Dongle. 雖然這個設備並未出現在相容清單內,但是目前為止使用上都還蠻順利的。你可以在環境架好了以後,再去購買,如果發現不相容可以馬上退貨。
Linux 環境安裝有 J2SDK 1.4.x (or later) 以及 Rococo Software s Impronto Developer Kit for Linux.
安裝至少 bluez-libs 和 bluez-utils 套件。
請在兩部電腦上都利用以下指令來確定你的環境是正確的(# 為註解) -import java.io.*
import javax.bluetooth.*
public class LocalInfo
{
public static void main(String args[]) throws BluetoothStateException {
LocalDevice localdev = null
try {
localdev = LocalDevice.getLocalDevice()
} catch (BluetoothStateException e) {
System.out.println("ERROR: cannot access local device")
System.exit(1)
}
System.out.println("a local bluetooth device is found:")
System.out.println(" Name: "+ localdev.getFriendlyName())
System.out.println("Address: "+ localdev.getBluetoothAddress())
System.out.println("\nIts device classes are:")
DeviceClass devcla = localdev.getDeviceClass()
System.out.println(devcla.toString())
System.out.println("Service Class: "+ devcla.getServiceClasses())
System.out.println("Major Device Class: "+ devcla.getMajorDeviceClass())
System.out.println("Minor Device Class: "+ devcla.getMinorDeviceClass())
}
}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
BluetoothChat/.classpath
BluetoothChat/.project
BluetoothChat/AndroidManifest.xml
BluetoothChat/bin/BluetoothChat.apk
BluetoothChat/bin/classes.dex
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChat$1.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChat$2.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChat$3.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChat.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChatService$AcceptThread.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChatService$ConnectedThread.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChatService$ConnectThread.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChatService.class
BluetoothChat/bin/com/example/android/BluetoothChat/DeviceListActivity$1.class
BluetoothChat/bin/com/example/android/BluetoothChat/DeviceListActivity$2.class
BluetoothChat/bin/com/example/android/BluetoothChat/DeviceListActivity$3.class
BluetoothChat/bin/com/example/android/BluetoothChat/DeviceListActivity.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$attr.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$drawable.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$id.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$layout.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$menu.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$string.class
BluetoothChat/bin/com/example/android/BluetoothChat/R.class
BluetoothChat/bin/resources.ap_
BluetoothChat/default.properties
BluetoothChat/gen/com/example/android/BluetoothChat/R.java
BluetoothChat/res/drawable/app_icon.png
BluetoothChat/res/drawable-hdpi/app_icon.png
BluetoothChat/res/layout/custom_title.xml
BluetoothChat/res/layout/device_list.xml
BluetoothChat/res/layout/device_name.xml
BluetoothChat/res/layout/main.xml
BluetoothChat/res/layout/message.xml
BluetoothChat/res/menu/option_menu.xml
BluetoothChat/res/values/strings.xml
BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChat.java
BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChatService.java
BluetoothChat/src/com/example/android/BluetoothChat/DeviceListActivity.java
BluetoothChat/bin/com/example/android/BluetoothChat
BluetoothChat/gen/com/example/android/BluetoothChat
BluetoothChat/src/com/example/android/BluetoothChat
BluetoothChat/bin/com/example/android
BluetoothChat/gen/com/example/android
BluetoothChat/src/com/example/android
BluetoothChat/bin/com/example
BluetoothChat/gen/com/example
BluetoothChat/src/com/example
BluetoothChat/bin/com
BluetoothChat/gen/com
BluetoothChat/res/drawable
BluetoothChat/res/drawable-hdpi
BluetoothChat/res/drawable-ldpi
BluetoothChat/res/drawable-mdpi
BluetoothChat/res/layout
BluetoothChat/res/menu
BluetoothChat/res/values
BluetoothChat/src/com
BluetoothChat/assets
BluetoothChat/bin
BluetoothChat/gen
BluetoothChat/res
BluetoothChat/src
BluetoothChat
BluetoothChat/.project
BluetoothChat/AndroidManifest.xml
BluetoothChat/bin/BluetoothChat.apk
BluetoothChat/bin/classes.dex
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChat$1.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChat$2.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChat$3.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChat.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChatService$AcceptThread.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChatService$ConnectedThread.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChatService$ConnectThread.class
BluetoothChat/bin/com/example/android/BluetoothChat/BluetoothChatService.class
BluetoothChat/bin/com/example/android/BluetoothChat/DeviceListActivity$1.class
BluetoothChat/bin/com/example/android/BluetoothChat/DeviceListActivity$2.class
BluetoothChat/bin/com/example/android/BluetoothChat/DeviceListActivity$3.class
BluetoothChat/bin/com/example/android/BluetoothChat/DeviceListActivity.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$attr.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$drawable.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$id.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$layout.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$menu.class
BluetoothChat/bin/com/example/android/BluetoothChat/R$string.class
BluetoothChat/bin/com/example/android/BluetoothChat/R.class
BluetoothChat/bin/resources.ap_
BluetoothChat/default.properties
BluetoothChat/gen/com/example/android/BluetoothChat/R.java
BluetoothChat/res/drawable/app_icon.png
BluetoothChat/res/drawable-hdpi/app_icon.png
BluetoothChat/res/layout/custom_title.xml
BluetoothChat/res/layout/device_list.xml
BluetoothChat/res/layout/device_name.xml
BluetoothChat/res/layout/main.xml
BluetoothChat/res/layout/message.xml
BluetoothChat/res/menu/option_menu.xml
BluetoothChat/res/values/strings.xml
BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChat.java
BluetoothChat/src/com/example/android/BluetoothChat/BluetoothChatService.java
BluetoothChat/src/com/example/android/BluetoothChat/DeviceListActivity.java
BluetoothChat/bin/com/example/android/BluetoothChat
BluetoothChat/gen/com/example/android/BluetoothChat
BluetoothChat/src/com/example/android/BluetoothChat
BluetoothChat/bin/com/example/android
BluetoothChat/gen/com/example/android
BluetoothChat/src/com/example/android
BluetoothChat/bin/com/example
BluetoothChat/gen/com/example
BluetoothChat/src/com/example
BluetoothChat/bin/com
BluetoothChat/gen/com
BluetoothChat/res/drawable
BluetoothChat/res/drawable-hdpi
BluetoothChat/res/drawable-ldpi
BluetoothChat/res/drawable-mdpi
BluetoothChat/res/layout
BluetoothChat/res/menu
BluetoothChat/res/values
BluetoothChat/src/com
BluetoothChat/assets
BluetoothChat/bin
BluetoothChat/gen
BluetoothChat/res
BluetoothChat/src
BluetoothChat
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.