网上领取蓝牙手环免费领取手表是真的吗吗

2076人阅读
Android 蓝牙(BLE)
现在物联网搞的轰轰烈烈的,小米的手环等一系列产品,下面我们就来研究一下小米手环的记步功能
package com.zsl.bluetoothdemo.
import android.bluetooth.BluetoothA
import android.bluetooth.BluetoothD
import android.bluetooth.BluetoothG
import android.bluetooth.BluetoothGattC
import android.bluetooth.BluetoothM
import android.content.C
import android.content.I
import android.os.H
import java.util.ArrayL
import java.util.L
* 蓝牙的工具类
* Created by zsl on 15/5/25.
public class UniversalBluetoothLE {
public static UniversalBluetoothLE universalBluetoothLE;
private BluetoothAdapter mBluetoothA
private BluetoothManager bluetoothM
public static final int REQUEST_ENABLE_BLUETOOTH = 10010;
private boolean mS
private static final long SCAN_PERIOD = 10000;
BluetoothAdapter.LeScanCallback leScanC
List&BluetoothDevice& bluetoothDeviceList = new ArrayList&BluetoothDevice&();
Handler mHandler = new Handler();
LeScanListenter leScanL
private UniversalBluetoothLE(Context context) {
this.context =
this.bluetoothManager = (BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE);
this.mBluetoothAdapter = bluetoothManager.getAdapter();
leScanCallback = new BluetoothAdapter.LeScanCallback() {
public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) {
bluetoothDeviceList.add(device);
leScanListenter.leScanCallBack(bluetoothDeviceList);
* 获得到UniversalBluetoothLE对象
public static UniversalBluetoothLE inistance(Context context) {
if (universalBluetoothLE == null) {
universalBluetoothLE = new UniversalBluetoothLE(context);
return universalBluetoothLE;
* 检查蓝牙是否打开并且启动打开蓝牙的方法
public void openBbletooth() {
if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
context.startActivity(enableIntent);
* 开始(true)或结束(false)蓝牙扫描
private void scanLeDevice(final boolean enable) {
if (enable && mScanning == false) {
mHandler.postDelayed(new Runnable() {
public void run() {
mScanning = false;
mBluetoothAdapter.stopLeScan(leScanCallback);
}, SCAN_PERIOD);
mScanning = true;
mBluetoothAdapter.startLeScan(leScanCallback);
mScanning = false;
mBluetoothAdapter.stopLeScan(leScanCallback);
* 开始搜索蓝牙设备
* leScanListenter 搜索蓝牙设备的回调(返回设备列表)
public void startScanLeDevice(final LeScanListenter leScanListenter) {
bluetoothDeviceList.clear();
this.leScanListenter=leScanL
scanLeDevice(true);
* 停止搜索设备
public void stopScanLeDevice() {
if (leScanCallback == null)
scanLeDevice(false);
* 搜索蓝牙的回调
public interface LeScanListenter {
void leScanCallBack(List&BluetoothDevice& bluetoothDeviceList);
* 得到BluetoothGatt
* device 设备
* autoConnect 是否自动链接
* bluetoothGattCallback 回调
public BluetoothGatt getConnectGatt(BluetoothDevice device,boolean autoConnect,BluetoothGattCallback bluetoothGattCallback){
return device.connectGatt(context, autoConnect, bluetoothGattCallback);
universalBluetoothLE = UniversalBluetoothLE.inistance(MainActivity.this);
检测是否打开蓝牙并且请求系统打开蓝牙
universalBluetoothLE.openBbletooth();
mBluetoothGatt=universalBluetoothLE.getConnectGatt(device,true,mGattCallback);
mBluetoothGatt.connect();
最后再实现一个GattCallback回调,搞定
看看小米的记步功能吧,完美获取哦,有小米手环的可以测试哦,第三个是我的小米手环。
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:308511次
积分:4755
积分:4755
排名:第4082名
原创:128篇
评论:342条
文章:13篇
阅读:117334
阅读:8000
阅读:16908
(1)(2)(1)(3)(4)(6)(19)(27)(29)(20)(8)(12)(2)虽然三星电子在新硬件的跟进上从不落后,但是因为企业庞大、千头万绪,加之市场战略和产品定价上的基因影响,往往让普通消费者看上去很美好。比如在可穿戴这一领域,智能手表、手环的市场占有率远不如手机那样耀眼。继2014年的首款健身手环Gear&Fit之后,外媒报道称,暌违两年的三星准备重新进入这一市场。现在Gear&Fit二代和蓝牙耳机Gear&IconX的照片在网上曝光。对于Gear&Fit二代来说,上手图显示其搭载了更加贴合手腕的曲面屏、符合人体工程学,加入GPS芯片,底部为充电触点。Gear&IconX蓝牙耳机则完全是无线设计,据说线控被集成在触摸中,还配备了充电底座。另外造型上,可以看到设计了耳蜗支撑,防止运动脱落。
天津重庆哈尔滨沈阳长春石家庄呼和浩特西安太原兰州乌鲁木齐成都昆明贵阳长沙武汉郑州济南青岛烟台合肥南京杭州东莞南宁南昌福州厦门深圳温州佛山宁波泉州惠州银川
本城市下暂无经销商
下载中关村在线Android 客户端
下载中关村在线 iPhone 客户端
下载中关村在线Windows8客户端
成为中关村在线微信好友和手环配对必须要用App配对连接吗,你们都是哪下的?_百度知道
和手环配对必须要用App配对连接吗,你们都是哪下的?
是需要APP来配对连接的。去手机软件市场上就可以下载了。
来自团队:
其他类似问题
为您推荐:
其他2条回答
第一次必须配对app,否则不能使用,之后可以单独使用,记步睡眠都不受影响
是,手环官网下
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 120战网点 领取真的吗 的文章

 

随机推荐