Android BluetoothChat Sample
===================================
This sample shows how to implement two-way text chat over Bluetooth between two Android devices, using
all the fundamental Bluetooth API capabilities.
Introduction
------------
This sample should be run on two Android devices at the same time, to establish a two-way chat over
Bluetooth between the devices. Select "Made discoverable" in overflow menu on one device and click
on the Bluetooth icon on the other one, to find the device and establish the connection.
The sample demonstrates the following, using the [Bluetooth API][1]:
1. [Setting up][2] Bluetooth
2. [Scanning][3] for other Bluetooth devices
3. [Querying][4] the local Bluetooth adapter for paired Bluetooth devices
4. [Establishing RFCOMM][5] channels/sockets
5. [Connecting][6] to a remote device
6. [Transfering][7] data over Bluetooth
[1]: http://developer.android.com/guide/topics/connectivity/bluetooth.html
[2]: http://developer.android.com/guide/topics/connectivity/bluetooth.html#Permissions
[3]: http://developer.android.com/guide/topics/connectivity/bluetooth.html#FindingDevices
[4]: http://developer.android.com/guide/topics/connectivity/bluetooth.html#QueryingPairedDevices
[5]: http://developer.android.com/guide/topics/connectivity/bluetooth.html#ConnectingDevices
[6]: http://developer.android.com/guide/topics/connectivity/bluetooth.html#ConnectingAsAClient
[7]: http://developer.android.com/guide/topics/connectivity/bluetooth.html#ManagingAConnection
Pre-requisites
--------------
- Android SDK v22
- Android Build Tools v22.0.1
- Android Support Repository
Screenshots
-------------
<img src="screenshots/1-launch.png" height="400" alt="Screenshot"/> <img src="screenshots/2-devices.png" height="400" alt="Screenshot"/> <img src="screenshots/3-chat.png" height="400" alt="Screenshot"/>
Getting Started
---------------
This sample uses the Gradle build system. To build this project, use the
"gradlew build" command or use "Import Project" in Android Studio.
Support
-------
- Google+ Community: https://plus.google.com/communities/105153134372062985968
- Stack Overflow: http://stackoverflow.com/questions/tagged/android
If you've found an error in this sample, please file an issue:
https://github.com/googlesamples/android-BluetoothChat
Patches are encouraged, and may be submitted by forking this project and
submitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.
License
-------
Copyright 2014 The Android Open Source Project, Inc.
Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for
additional information regarding copyright ownership. The ASF licenses this
file to you under the Apache License, Version 2.0 (the "License"); you may not
use this file except in compliance with the License. You may obtain a copy of
the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations under
the License.
没有合适的资源?快使用搜索试试~ 我知道了~
MyBluetoothChat:测试蓝牙聊天
共185个文件
xml:54个
class:47个
png:22个
需积分: 0 1 下载量 51 浏览量
2021-05-14
11:41:30
上传
评论
收藏 3.18MB ZIP 举报
温馨提示
Android BluetoothChat示例 此示例演示如何使用所有基本的蓝牙API功能在两个Android设备之间通过蓝牙实现双向文本聊天。 介绍 此示例应同时在两个Android设备上运行,以在两个设备之间通过蓝牙建立双向聊天。 在一台设备的溢出菜单中选择“可发现”,然后在另一台设备上单击“蓝牙”图标,以找到该设备并建立连接。 该示例使用演示了以下内容: 蓝牙 其他蓝牙设备 本地蓝牙适配器中已配对的蓝牙设备 频道/套接字 到远程设备 通过蓝牙数据 先决条件 Android SDK v22 Android构建工具v22.0.1 Android支持存储库 屏幕截图 入门 本示例使用Gradle构建系统。 要构建此项目,请使用“ gradlew build”命令或在Android Studio中使用“导入项目”。 支持 Google+社区: https : //plus.googl
资源详情
资源评论
资源推荐
收起资源包目录
MyBluetoothChat:测试蓝牙聊天 (185个子文件)
INotificationSideChannel.aidl 1KB
resources-debug.ap_ 43KB
resources-debug-androidTest.ap_ 778B
Application-debug.apk 424KB
Application-debug-unaligned.apk 424KB
gradlew.bat 2KB
fileSnapshots.bin 63KB
taskArtifacts.bin 32KB
fileHashes.bin 26KB
outputFileStates.bin 19KB
gradle_project_sync_data.bin 596B
BluetoothChatFragment.class 9KB
BluetoothChatService.class 7KB
DeviceListActivity.class 5KB
MainActivity.class 3KB
BluetoothChatService$AcceptThread.class 3KB
BluetoothChatService$ConnectThread.class 3KB
LogView.class 3KB
BluetoothChatService$ConnectedThread.class 3KB
LogFragment.class 3KB
BluetoothChatFragment$3.class 3KB
Log.class 3KB
R$styleable.class 3KB
DeviceListActivity$3.class 2KB
DeviceListActivity$2.class 2KB
R$styleable.class 2KB
R$id.class 2KB
LogWrapper.class 1KB
BluetoothChatFragment$1.class 1KB
R$attr.class 1KB
BluetoothChatFragment$2.class 1KB
LogFragment$1.class 1KB
R$string.class 1KB
R$styleable.class 1KB
MessageOnlyLogFilter.class 1KB
SampleActivityBase.class 1KB
R$id.class 984B
R.class 961B
LogView$1.class 957B
DeviceListActivity$1.class 956B
R$attr.class 929B
R$dimen.class 861B
R$attr.class 847B
BuildConfig.class 762B
BuildConfig.class 747B
R$style.class 739B
R$color.class 605B
R$layout.class 605B
R.class 602B
R$color.class 587B
R.class 551B
R$drawable.class 547B
R$dimen.class 539B
R$style.class 497B
R$menu.class 471B
Constants.class 453B
R$dimen.class 431B
LogNode.class 211B
classes.dex 1.4MB
build.gradle 1KB
settings.gradle 25B
build.gradle 14B
gradlew 5KB
Application.iml 8KB
BluetoothChat.iml 919B
classes.jar 744KB
classes-636bc75af389573d16d7c771b5add13d416f7432.jar 287KB
internal_impl-21.0.2.jar 208KB
internal_impl-21.0.2-64d11fc615b8ccc0932250f84ea81066034e1a51.jar 69KB
gradle-wrapper.jar 49KB
classes.jar 42KB
classes-f8033c7ca57ef061b4d8862a2ff903a16bd515cd.jar 22KB
classes.jar 18KB
classes-08ec5907a503bbc613bec6a5b4a784fb7d604a64.jar 9KB
support-annotations-21.0.2-13e407fff313a8cb1f51eb3d0984844bfff98620.jar 2KB
R.java 47KB
BluetoothChatService.java 18KB
BluetoothChatFragment.java 15KB
Log.java 8KB
DeviceListActivity.java 8KB
LogView.java 5KB
MainActivity.java 4KB
LogFragment.java 4KB
R.java 4KB
LogWrapper.java 3KB
R.java 2KB
LogNode.java 2KB
MessageOnlyLogFilter.java 2KB
SampleActivityBase.java 2KB
Constants.java 1KB
BuildConfig.java 481B
BuildConfig.java 470B
LICENSE 11KB
cache.properties.lock 17B
README.md 3KB
CONTRIB.md 2KB
CONTRIBUTING.md 2KB
.name 13B
NOTICE 614B
2-devices.png 177KB
共 185 条
- 1
- 2
缪之初
- 粉丝: 32
- 资源: 4720
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0