如何实现android蓝牙取消配对开发 自动配对连接,并不弹出提示框

当前位置 & &
& 新版Android系统不用配对即可连接蓝牙
新版Android系统不用配对即可连接蓝牙
12:07:13&&作者:永辉
编辑:永辉 &&)
让小伙伴们也看看:
文章观点支持
当前平均分:0(0 次打分)
[04-04][04-04][04-04][04-04][04-04][04-04][04-04][04-03][04-03][04-03]
登录驱动之家
没有帐号?
用合作网站帐户直接登录如何实现android蓝牙开发 自动配对连接,并不弹出提示框_百度知道
如何实现android蓝牙开发 自动配对连接,并不弹出提示框
提问者采纳
String str) throws Exception
Method removeBondMethod = btClass.getMessage());/
import android.i(&
import android.length.convertPinToBytes(&quot,xml注册 1
&receiver&
Boolean returnValue = (Boolean) createBondMethod.printStackTrace();
return returnValue.createBond( throw new RuntimeException(e.getClass().getFields();
if (device.invoke(btDevice.getMethod(&
/returnValue& device.getName() + &&#47, btDevice);
for (i = 0.printStackTrace(), &quot.createBond(device, btDevice.booleanValue().&
L/ cancelBondProcess()
Boolean returnValue = (Boolean) createBondMcode&
catch (SecurityException e)
&#47.lang.BluetoothConnectActivityReceiver&quot, device);//
catch (IllegalArgumentException e)
&#47.booleanValue();setPin&quot!BluetoothA
catch (SecurityException e)
&#47.booleanValue(); &gt:name=&); hideMethod.getParcelableExtra(BluetoothD&quot.lang.printStackTrace().EXTRA_DEVICE).cancelPairingUserInput(btDandroid.getClass()./ 检查蓝牙地址是否有效
Log, BluetoothDevice btDevice)
throws Exception
Method createBondMethod = btClass, &quot.BOND_BONDED)
Log.isEnabled())
bluetoothAdapter, &
ClsUtils.d(&;);.getClass(), &quot.getMethod(&; 取消配对
static public boolean cancelBondProcess(Class btC).getRemoteDevice(strAddr).
BluetoothDevice device = bluetoothA throw new RuntimeException(e;
Boolean returnValue = (Boolean) removeBondMand the i is. byte[] pinBytes = BluetoothD
BluetoothDevice device)
throws Exception
Method createBondMethod = btCHAS BOND_BONDED&quot.&/;mylog&&lt.getMethod(& TODO Auto-generated method stub
if (tag11111&quot.enable();mylog& TODO Auto-generated catch block
} / &#47, &
public class ClsUtils
static public boolean createBond(Class btC&#47.d(&/
/ 手机和蓝牙采集器配对
ClsU TODO Auto-generated catch block
执行时直接使用.PAIRING_REQUEST&quot.getMethods();
ClsU:name=&&#47, hideMethod[i];;removeBond&).e(&
catch (Exception e)
&#47, & TODO Auto-generated catch block
catch (IllegalArgumentException e)
/ throw new RuntimeException(e;
/&#47.invoke(btDevice);
e, &quot!&
return returnValue,就直接把这个设备对象传给全局的remoteDevice
result = throw new RuntimeException(e;intent-filter&
for (!&&#47  我就开始查找怎么关闭这个蓝牙配对提示框.getMessage()).Log.d(&quot.BluetoothD
remoteDevice =/ 如果绑定成功;code&code& TODO Auto-generated catch block
e, device).M allF/&#47: 01
public static boolean pair(String strA
Boolean returnValue = (Boolean) createBondMethod.getClass().getBondState() ;
自己在收到广播时处理并将预先输入的密码设置进去 01
public class BluetoothConnectActivityReceiver extends BroadcastReceiver
String strPsw = &&#47.e(&quot, BluetoothDevice btD /
int i = 0.getMessage()); 配对完毕就把这个设备对象传给全局的remoteDevice
return returnValue./1234&
static public void printAllInform(Class clsShow)
e.getDefaultAdapter();), device,后面还是伟大的android源码帮助了我;/
catch (Exception e)
/ 手机和蓝牙采集器配对
ClsUtils, strPsw);//
return returnV/
catch (Exception e)
BluetoothDevice device)
throws Exception
Method createBondMethod = btC
bluetoothAdapter.devAdd un effient, device).getDeclaredMethod(&quot.booleanValue();
static public boolean setPin(Class btC 取得所有常量
Field[] allFields = clsShow.;&#47, strPsw);0&
catch (Exception e)
/setPiN.invoke(device);
& &#47.invoke(btDevice);&#47.invoke(device); i &
Log, allFields[i]; /
public void onReceive(C
static public boolean removeBond(Class btC /;/code&gt.printStackTrace();createBond&quot.getMessage());Field name&code&gt.setPin(btDevice.
if (.d(&).equals(
&quot.getMethod(&quot, String strPsw)
boolean result = false.getName()):&
&lt.e(& 取得所有方法
Method[] hideMethod = clsScancelBondProcess&
&&#47.F/&#47, strPsw)!&
Boolean returnValue = (Boolean) removeBondMmylog&quot, btDevice).printStackTrace().getBytes()}); i++)
catch (Exception e)
&#47。  在源码 BluetoothDevice 类中还有两个隐藏方法  cancelBondProcess()和cancelPairingUserInput()  这两个方法一个是取消配对进程一个是取消用户输入  下面是自动配对的代码Mainfest!bluetoothAcancelPairingUserInput&quot.printStackTrace().class}).PAIRING_REQUEST& + returnValue).getClass();method name&quot, Intent intent)
/);;& 手机和蓝牙采集器配对
ClsUtils, device.reflect.getClass(); /), BluetoothDevice btDevice)
throws Exception
Method removeBondMethod = btClass.printStackTrace().
e.getAction();
BluetoothDevice btDevice = intent
BluetoothAdapter bluetoothAdapter = BluetoothAdapter
05&lt.createBond(btD;
import java.setPin(pinBytes);mylog&); 取消用户输入
static public boolean cancelPairingUserInput(Class btC i &
NOT BOND_BONDED&quot.setPin(&/
return true.setPin(&#47.getClass();intent-filter&
remoteDevice = device.printStackTrace()!= BluetoothDevice.d(& TODO Auto-generated catch block
e.checkBluetoothAddress(strAddr))
050ddd&quot.printStackTrace();.createBond(device.cancelDiscovery(),
new Class[]
{byte[].getClass(); i++)
new Object[]
其他类似问题
android的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁lyp2002924 - ITeye技术网站
博客分类:
链接地址
http://my.oschina.net/u/1049180/blog/298602
博客分类:
fill device memory lite 这个应用 可以模拟耗尽手机内存,测试app在内存低情况下反应。
附件为此应用的apk文件。
博客分类:
http://blog.csdn.net/fenglibing/article/details/
博客分类:
1: window-&preference-&General-&Appearance-&Label Decorations 可以控制是否显示svn文件的版本号。
2:window-&preference-&Team-&Console-&show console automatically (on output), 可以显示svn更新的文件信息。
博客分类:
* @return the destination apn ID.
private static int getWapAPN() {
int nRet = -1;
String projection[] = { &_id,apn,type& };
Uri uri = Uri.parse(&content://telephony/carriers&);
// current不为空表示可以使用的APN
Cursor cr = mContext.getContentResolver().query(u ...
博客分类:
private Bitmap outputRound(Bitmap bitmap){
if(bitmap == null)
int w = bitmap.getWidth();
int h = bitmap.getHeight();
Bitmap localBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_4444);
Canvas localCanvas = new Canvas(localBitmap);
Path path =
博客分类:
CORE/6.506.4.1 OpenCORE/2.02 (LAndroid 2.2)
User-Agent: stagefright/1.1 (LAndroid 3.2)
...
User-Agent: stagefright/1.1 (LAndroid 4.0.0)
User-Agent: stagefright/1.2 (LAndroid 4.0.2)
stagefright/1.1 存在严重的bug ,seek ,http 播放容错性太差,只做一次http请求。
博客分类:
i have a problem with a custom view with running on api 15 (Android 4.0.3)
the code:
canvas.clipRect(10,10,100,100, Region.Op.DIFFERENCE);
canvas.drawPaint(myPaint);
fills the full area of the view and not just the DIFFERENCE... it works with api 8 and 9...
XOR, Difference and ReverseDifference clip
博客分类:
基于opencv
用于图片裁剪。有以下特点:
1.能进行人脸识别。图片中有人脸,将自动视为人脸区域为重要区域,将不会被裁剪掉。
2.自动识别其它重要区域。如果图片中未识别出人脸,则会根据特征分布计算出重区域。
总而言之,自动识别图片中的重要区域,并且在图片裁剪时保留重要区域。
目前已经用于一淘玩客
/beartung/tclip-android
http://code.taobao.org/p/tclip/src/
博客分类:
AlarmManager am = (AlarmManager)cur.getSystemService(Context.ALARM_SERVICE);
am.set(AlarmManager.RTC, System.currentTimeMillis()+300,
PendingIntent.getActivity(cur, 0, new Intent(cur,MoreAct.class), 0));
博客分类:
use mons.net.smtp.AuthenticatingSMTPClient
private void sendLogByEmail(){
String sender =
String recipient =
String sendMsg = getData();
if(sendMsg == null)
AuthenticatingSMTPClient clie ...
博客分类:
此文介绍了 android设计中的大体的原则问题 官方设计
/design/patterns/actionbar.html
博客分类:
android dialog的动画,使用dialog 的android/view/Window.setWindowAnimations 实现
此处的参数必须 使用如下的resid,即要一次性的包含俩动画。
&resources&
&style name=&dialogWindowAnim& parent=&android:Animation& mce_bogus=&1&&
&item name=&android:windowEnterAnimation&&@ ...
博客分类:
http://blog.csdn.net/yuanbohx/article/details/8109042
博客分类:
android中也是可以设置各种中文字体的,但是需要导入字体资源,在android assets文件夹中建立fonts文件夹,然后在此放入字体库ttf 即可。经测试有些库是不兼容的,附件有经过测试可以用的库。
& 上一页 1
lyp2002924
浏览: 32275 次
while (c.moveToNext()) {}

我要回帖

更多关于 android 弹出提示信息 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信