普通安卓手机蓝牙如何匹配苹果蓝牙连接安卓手机的蓝牙

下次自动登录&|
当前位置:
蓝牙耳机怎么连接手机 小方法教你简单配对连接(图)(正文)
蓝牙耳机怎么连接手机 小方法教你简单配对连接(图)
&  内容简介:&蓝牙耳机怎么连接手机&近日成为不少车主的难题。2012年新交规中不准边开车边打手机迫使不少车主选择购买蓝牙耳机,不过很多车主不知道蓝牙耳机怎么连接手机,今天世界工厂网小编为您解决蓝牙耳机怎么连接手机这个问题。
  现代社会越来越科技化,蓝牙的使用也越来越普及,再加上2013年史上最严交规的实施,边开车边打电话将面临扣2分的处罚,很多车主选择购买蓝牙耳机,买过之后却苦于不知道蓝牙耳机怎么连接手机,下面来看看解决方法吧。
  第一次用蓝牙耳机,蓝牙耳机怎么连接手机呢?
  1、一般情况下,蓝牙耳机进入配对状态时,只需要一直按住开机按键10秒左右别松手,耳机就会从关机转为开机再转为配对状态,其表现为耳机指示灯(长亮)。然后用手机搜索蓝牙设置,就可以找到你的耳机。例如WEP200WEP310BH980BH320BH330等等.....
  2、有些耳机的出厂设置是比较复杂的,例如索爱的HBH-602HBH608HBH610A和诺基亚的HS-36W等....602在对码的时候,要先打开耳机,然后同时后按住+、-号10秒左右,这时指示灯会红绿交替闪动,这样就可以用手机搜索蓝牙设备了。36W是在耳机开机后,同时按住开机按键和+号10秒左右,其他步骤都和普通耳机一样。
  3、耳机进入配对后,手机要搜索蓝牙设备,一般手机用5秒钟左右的时间可以搜索到耳机,然后在手机上选择你找到的蓝牙耳机设备,手机会提示你输入密码。大部分的手机密码是0000或者1234,但是也有个别是厂家特别设置的,在你的耳机说明书里会有详细的记录。
  4,当手机搜索到耳机,同时你也正确输入了密码后,并不是说你的手机就可以用蓝牙耳机来接听电话了。现在很多手机在找到蓝牙设备后还需要和耳机进行连接,如果你的手机没有在设置里与耳机进行连接的话,还是不能接听电话的。当然也有的手机如摩托罗拉的V3,就不需要你再另外去连接耳机了,只要配对成功,手机会很智能化的把耳机连接起来。
  经过上面的介绍,车主们对蓝牙耳机怎么连接手机已经有了一定的了解了吧,购买蓝牙耳机后,要先对蓝牙耳机和手机进行配对连接,由于各种手机的出厂设置是不一样的,所以小编在此建议车主们看下自己手机的使用手册,根据手册来设置连接。
欢迎转载,转载请注明作者和出处!
编辑:李晨
更多相关资讯:
如果您认为此信息侵犯了您的合法权益,请您将相关资质证明和您的权利要求发送至,世界工厂网工作人员会尽快回复处理!
热门资讯点击
热门关键词怎么才能使用iphone的蓝牙和其他手机配对_百度知道
怎么才能使用iphone的蓝牙和其他手机配对
就是和其他非iphone的手机配对
提问者采纳
包括和其他iPhone手机。没越狱的话文件的传输只能用iTunes,iPhone蓝牙仅仅是可以连接蓝牙耳机键盘等设备使用的,是不可以进行文件传送的非常遗憾的告诉你
提问者评价
太感谢了,真心有用
其他类似问题
为您推荐:
其他3条回答
iphone的蓝牙不能进行文件传输。但是你的iphone越狱了安装AirBlueSharing这款插件就能传送文件了。
iphone的蓝牙只能和iphone配对
iphone的蓝牙是不能与其他机子配对的。。
您可能关注的推广
iphone的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁当前访客身份:游客 [
当前位置:
// 自动配对设置Pin值
static public boolean autoBond(Class btClass, BluetoothDevice device, String strPin)
throws Exception {
Method autoBondMethod = btClass.getMethod(&setPin&, new Class[] { byte[].class });
Boolean result = (Boolean) autoBondMethod
.invoke(device, new Object[] { strPin.getBytes() });
// 开始配对
static public boolean createBond(Class btClass, BluetoothDevice device) throws Exception {
Method createBondMethod = btClass.getMethod(&createBond&);
Boolean returnValue = (Boolean) createBondMethod.invoke(device);
return returnValue.booleanValue();
&使用上面的代码可以实现配对,但是会出现输入提示框(点击取消后,查看配对是已配对)
我想屏蔽这个提示框,那为大神知道怎么做了?或者使用其它方式实现匹配
下面是进行匹配时 弹出提示框的日志,我想如果我不能屏蔽它,那么我可以通过代码关闭它吗
05-18 17:26:54.779: I/BluetoothEventLoop.cpp(171): agent_event_filter: Received method org.bluez.Agent:RequestPinCode 05-18 17:26:54.790: I/ActivityManager(171): Starting: Intent { act=android.bluetooth.device.action.PAIRING_REQUEST flg=0x cmp=com.android.settings/.bluetooth.BluetoothPairingDialog (has extras) } from pid 252 05-18 17:26:55.190: I/ActivityManager(171): Displayed com.android.settings/.bluetooth.BluetoothPairingDialog: +374ms
共有17个答案
<span class="a_vote_num" id="a_vote_num_
Mainfest,xml注册
&receiver android:name=&.BluetoothConnectActivityReceiver& &
&intent-filter&
&action android:name=&android.bluetooth.device.action.PAIRING_REQUEST& /&
&/intent-filter&
&/receiver&
自己在收到广播时处理并将预先输入的密码设置进去
public class BluetoothConnectActivityReceiver extends BroadcastReceiver
String strPsw = &0&;
public void onReceive(Context context, Intent intent)
// TODO Auto-generated method stub
if (intent.getAction().equals(
&android.bluetooth.device.action.PAIRING_REQUEST&))
BluetoothDevice btDevice = intent
.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
// byte[] pinBytes = BluetoothDevice.convertPinToBytes(&1234&);
// device.setPin(pinBytes);
Log.i(&tag11111&, &ddd&);
ClsUtils.setPin(btDevice.getClass(), btDevice, strPsw); // 手机和蓝牙采集器配对
ClsUtils.createBond(btDevice.getClass(), btDevice);
ClsUtils.cancelPairingUserInput(btDevice.getClass(), btDevice);
catch (Exception e)
// TODO Auto-generated catch block
e.printStackTrace();
那个很NB的类是这样的,添加上楼主的精华
/************************************ 蓝牙配对函数 * **************/
import java.lang.reflect.F
import java.lang.reflect.M
import android.bluetooth.BluetoothD
import android.util.L
public class ClsUtils
* 与设备配对 参考源码:platform/packages/apps/Settings.git
* /Settings/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
static public boolean createBond(Class btClass, BluetoothDevice btDevice)
throws Exception
Method createBondMethod = btClass.getMethod(&createBond&);
Boolean returnValue = (Boolean) createBondMethod.invoke(btDevice);
return returnValue.booleanValue();
* 与设备解除配对 参考源码:platform/packages/apps/Settings.git
* /Settings/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
static public boolean removeBond(Class btClass, BluetoothDevice btDevice)
throws Exception
Method removeBondMethod = btClass.getMethod(&removeBond&);
Boolean returnValue = (Boolean) removeBondMethod.invoke(btDevice);
return returnValue.booleanValue();
static public boolean setPin(Class btClass, BluetoothDevice btDevice,
String str) throws Exception
Method removeBondMethod = btClass.getDeclaredMethod(&setPin&,
new Class[]
{byte[].class});
Boolean returnValue = (Boolean) removeBondMethod.invoke(btDevice,
new Object[]
{str.getBytes()});
Log.e(&returnValue&, && + returnValue);
catch (SecurityException e)
// throw new RuntimeException(e.getMessage());
e.printStackTrace();
catch (IllegalArgumentException e)
// throw new RuntimeException(e.getMessage());
e.printStackTrace();
catch (Exception e)
// TODO Auto-generated catch block
e.printStackTrace();
// 取消用户输入
static public boolean cancelPairingUserInput(Class btClass,
BluetoothDevice device)
throws Exception
Method createBondMethod = btClass.getMethod(&cancelPairingUserInput&);
// cancelBondProcess()
Boolean returnValue = (Boolean) createBondMethod.invoke(device);
return returnValue.booleanValue();
// 取消配对
static public boolean cancelBondProcess(Class btClass,
BluetoothDevice device)
throws Exception
Method createBondMethod = btClass.getMethod(&cancelBondProcess&);
Boolean returnValue = (Boolean) createBondMethod.invoke(device);
return returnValue.booleanValue();
* @param clsShow
static public void printAllInform(Class clsShow)
// 取得所有方法
Method[] hideMethod = clsShow.getMethods();
int i = 0;
for (; i & hideMethod. i++)
Log.e(&method name&, hideMethod[i].getName() + &;and the i is:&
// 取得所有常量
Field[] allFields = clsShow.getFields();
for (i = 0; i & allFields. i++)
Log.e(&Field name&, allFields[i].getName());
catch (SecurityException e)
// throw new RuntimeException(e.getMessage());
e.printStackTrace();
catch (IllegalArgumentException e)
// throw new RuntimeException(e.getMessage());
e.printStackTrace();
catch (Exception e)
// TODO Auto-generated catch block
e.printStackTrace();
执行时直接使用:
public static boolean pair(String strAddr, String strPsw)
boolean result =
BluetoothAdapter bluetoothAdapter = BluetoothAdapter
.getDefaultAdapter();
bluetoothAdapter.cancelDiscovery();
if (!bluetoothAdapter.isEnabled())
bluetoothAdapter.enable();
if (!BluetoothAdapter.checkBluetoothAddress(strAddr))
{ // 检查蓝牙地址是否有效
Log.d(&mylog&, &devAdd un effient!&);
BluetoothDevice device = bluetoothAdapter.getRemoteDevice(strAddr);
if (device.getBondState() != BluetoothDevice.BOND_BONDED)
Log.d(&mylog&, &NOT BOND_BONDED&);
ClsUtils.setPin(device.getClass(), device, strPsw); // 手机和蓝牙采集器配对
ClsUtils.createBond(device.getClass(), device);
remoteDevice = // 配对完毕就把这个设备对象传给全局的remoteDevice
catch (Exception e)
// TODO Auto-generated catch block
Log.d(&mylog&, &setPiN failed!&);
e.printStackTrace();
Log.d(&mylog&, &HAS BOND_BONDED&);
ClsUtils.createBond(device.getClass(), device);
ClsUtils.setPin(device.getClass(), device, strPsw); // 手机和蓝牙采集器配对
ClsUtils.createBond(device.getClass(), device);
remoteDevice = // 如果绑定成功,就直接把这个设备对象传给全局的remoteDevice
catch (Exception e)
// TODO Auto-generated catch block
Log.d(&mylog&, &setPiN failed!&);
e.printStackTrace();
that is all
--- 共有 2 条评论 ---
yes!we should! 这种setpin方式一般对dongle还可以,对手机就没作用!
(4年前)&nbsp&
所有的配对请求都会发送这个广播android.bluetooth.device.action.PAIRING_REQUEST
在接受广播时最好添加个 if
来判断是否是你需要连接的设备
(4年前)&nbsp&
<span class="a_vote_num" id="a_vote_num_
下班都回家抱老婆了吗 怎么没人了
<span class="a_vote_num" id="a_vote_num_
这个问题有解吗?
<span class="a_vote_num" id="a_vote_num_
引用来自“杨俊构”的答案这个问题有解吗?有点眉目& 还在测试
--- 共有 1 条评论 ---
测试好了,源码能发给我吗!不尽感激,我邮箱
(4年前)&nbsp&
<span class="a_vote_num" id="a_vote_num_
引用来自“billowworld”的答案引用来自“杨俊构”的答案这个问题有解吗?有点眉目& 还在测试哥们怎么计划啊?有新的进展share一下哈!
<span class="a_vote_num" id="a_vote_num_
引用来自“杨俊构”的答案
引用来自“billowworld”的答案
引用来自“杨俊构”的答案
这个问题有解吗?
有点眉目& 还在测试
哥们怎么计划啊?有新的进展share一下哈!
设备被拿走了,没发测试。
下面的代码包含:一个取消配对输入和取消配对进程的方法
我的思路是在收到:android.bluetooth.device.action.PAIRING_REQUEST&配对请求时调用取消输入方法,在我们调用createBond方法时 不论用户是否在弹出框选择配对还是取消配对 都已经配对成功,
所以只要我们屏蔽掉弹出配对提示框就可以了
package com.testBlueT
import java.lang.reflect.F
import java.lang.reflect.M
import android.bluetooth.BluetoothD
import android.util.L
public class BluetoothUtils {
* 与设备配对 参考源码:platform/packages/apps/Settings.git
* /Settings/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
static public boolean createBond(Class btClass, BluetoothDevice btDevice) throws Exception {
Method createBondMethod = btClass.getMethod(&createBond&);
Boolean returnValue = (Boolean) createBondMethod.invoke(btDevice);
return returnValue.booleanValue();
* 与设备解除配对 参考源码:platform/packages/apps/Settings.git
* /Settings/src/com/android/settings/bluetooth/CachedBluetoothDevice.java
static public boolean removeBond(Class btClass, BluetoothDevice btDevice) throws Exception {
Method removeBondMethod = btClass.getMethod(&removeBond&);
Boolean returnValue = (Boolean) removeBondMethod.invoke(btDevice);
return returnValue.booleanValue();
static public boolean setPin(Class btClass, BluetoothDevice btDevice,
String str) throws Exception {
Method removeBondMethod = btClass.getDeclaredMethod(&setPin&,
new Class[] { byte[].class });
Boolean returnValue = (Boolean) removeBondMethod.invoke(btDevice,
new Object[] { str.getBytes() });
Log.e(&returnValue&, && + returnValue);
} catch (SecurityException e) {
// throw new RuntimeException(e.getMessage());
e.printStackTrace();
} catch (IllegalArgumentException e) {
// throw new RuntimeException(e.getMessage());
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
// 取消用户输入
static public boolean cancelPairingUserInput(Class btClass, BluetoothDevice device)
throws Exception {
Method createBondMethod = btClass.getMethod(&cancelPairingUserInput&);
// cancelBondProcess()
Boolean returnValue = (Boolean) createBondMethod.invoke(device);
return returnValue.booleanValue();
// 取消配对
static public boolean cancelBondProcess(Class btClass, BluetoothDevice device)
throws Exception {
Method createBondMethod = btClass.getMethod(&cancelBondProcess&);
Boolean returnValue = (Boolean) createBondMethod.invoke(device);
return returnValue.booleanValue();
* @param clsShow
static public void printAllInform(Class clsShow) {
// 取得所有方法
Method[] hideMethod = clsShow.getMethods();
int i = 0;
for (; i & hideMethod. i++) {
Log.e(&method name&, hideMethod[i].getName());
// 取得所有常量
Field[] allFields = clsShow.getFields();
for (i = 0; i & allFields. i++) {
Log.e(&Field name&, allFields[i].getName());
} catch (SecurityException e) {
// throw new RuntimeException(e.getMessage());
e.printStackTrace();
} catch (IllegalArgumentException e) {
// throw new RuntimeException(e.getMessage());
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
<span class="a_vote_num" id="a_vote_num_
可以了的,楼主,我测试了我的机器是OK的!再问楼主一个问题,我在配对成功后如何发起Handsfree的服务呢?
<span class="a_vote_num" id="a_vote_num_
引用来自“杨俊构”的答案可以了的,楼主,我测试了我的机器是OK的!再问楼主一个问题,我在配对成功后如何发起Handsfree的服务呢?代码贴出下
&Handsfree .?你做蓝牙耳机吗& 不了解
你看是不是这个吧
<span class="a_vote_num" id="a_vote_num_
顶一个,非常需要,有源码吗?发个来看看
<span class="a_vote_num" id="a_vote_num_
做两个蓝牙设备之间自动匹配需要两个设备都装上apk吧,如果只有一个设备安装代码生成的apk是无法完成自动配对
更多开发者职位上
有什么技术问题吗?
补全的其它问题
类似的话题

我要回帖

更多关于 苹果蓝牙连接安卓 的文章

 

随机推荐