登录
首页 » Android » 高价值蓝牙4.0实现

高价值蓝牙4.0实现

于 2023-07-19 发布 文件大小:8.88 kB
0 27
下载积分: 2 下载次数: 1

代码说明:

实现了蓝牙的自动打开、断开,设备连接和关闭。本源码在android4.0以上才能运行, 这套源码是我做智能设备的时候使用的,能很好的运行。

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 高仿人人网android客户端主界面 示例源码下载
    SlidingMenu https://github.com/jfeinstein10/SlidingMenu     ActionBarSherlock https://github.com/JakeWharton/ActionBarSherlock
    2013-10-23下载
    积分:1
  • android open gl 示例代码下载
    [实例简介]Open GL 入门级示例 [实例截图] [核心代码]package com.china.gltry;import javax.microedition.khronos.egl.EGL10;import javax.microedition.khronos.egl.EGL11;import javax.microedition.khronos.egl.EGLConfig;import javax.microedition.khronos.egl.EGLContext;import javax.microedition.khronos.egl.EGLDisplay;import javax.microedition.khronos.egl.EGLSurface;import javax.microedition.khronos.opengles.GL;import android.view.SurfaceHolder;/** * An EGL helper class. */public class EGLHelper{ public EGLHelper() { } /** * Initialize EGL for a given configuration spec. * @param configSpec */ public void start(int[] configSpec){ /* * Get an EGL instance */ mEgl = (EGL10) EGLContext.getEGL(); /* * Get to the default display. */ mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); /* * We can now initialize EGL for that display */ int[] version = new int[2]; mEgl.eglInitialize(mEglDisplay, version); EGLConfig[] configs = new EGLConfig[1]; int[] num_config = new int[1]; mEgl.eglChooseConfig(mEglDisplay, configSpec, configs, 1, num_config); mEglConfig = configs[0]; /* * Create an OpenGL ES context. This must be done only once, an * OpenGL context is a somewhat heavy object. */ mEglContext = mEgl.eglCreateContext(mEglDisplay, mEglConfig, EGL10.EGL_NO_CONTEXT, null); mEglSurface = null; } /* * Create and return an OpenGL surface */ public GL createSurface(SurfaceHolder holder) { /* * The window size has changed, so we need to create a new * surface. */ if (mEglSurface != null) { /* * Unbind and destroy the old EGL surface, if * there is one. */ mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); mEgl.eglDestroySurface(mEglDisplay, mEglSurface); } /* * Create an EGL surface we can render into. */ mEglSurface = mEgl.eglCreateWindowSurface(mEglDisplay, mEglConfig, holder, null); /* * Before we can issue GL commands, we need to make sure * the context is current and bound to a surface. */ mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext); GL gl = mEglContext.getGL(); return gl; } /** * Display the current render surface. * @return false if the context has been lost. */ public boolean swap() { mEgl.eglSwapBuffers(mEglDisplay, mEglSurface); /* * Always check for EGL_CONTEXT_LOST, which means the context * and all associated data were lost (For instance because * the device went to sleep). We need to sleep until we * get a new surface. */ return mEgl.eglGetError() != EGL11.EGL_CONTEXT_LOST; } public void finish() { if (mEglSurface != null) { mEgl.eglMakeCurrent(mEglDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT); mEgl.eglDestroySurface(mEglDisplay, mEglSurface); mEglSurface = null; } if (mEglContext != null) { mEgl.eglDestroyContext(mEglDisplay, mEglContext); mEglContext = null; } if (mEglDisplay != null) { mEgl.eglTerminate(mEglDisplay); mEglDisplay = null; } } EGL10 mEgl; EGLDisplay mEglDisplay; EGLSurface mEglSurface; EGLConfig mEglConfig; EGLContext mEglContext;}
    2015-04-06下载
    积分:1
  • gallery_load_layout
    andriod多控件滑动gallery加载布局文件(滑动)(the andriod more than the control slide, gallery load the layout file (slide). rar)
    2012-07-03 14:31:32下载
    积分:1
  • Android手机虚拟GPS定位源码
    利用hook实现GPS虚拟定位
    2018-01-25下载
    积分:1
  • Mp3Player01
    MP3播放器源代码 经过测试的部分源代码(MP3 player after part of the source code test source code )
    2012-07-24 17:31:21下载
    积分:1
  • IAR FOR AVR
    【实例简介】
    2021-08-06 00:30:55下载
    积分:1
  • android Gallery实现异步加载网络图片实例完整源码下载(亲测通过)
    android Gallery实现异步加载网络图片实例完整源码下载(亲测通过)
    2014-05-14下载
    积分:1
  • Android4.0 Settings
    Android4.0 的Setting.apk源码,可以查看学习一下,但是,有个问题,导入到Eclipse的时候有错误,因为需要调用系统下的包,而系统下的包都是以一种@hide隐藏着,只允许系统下的类调用,所以,这个外项目是无法调用到的。
    2022-04-09 19:41:03下载
    积分:1
  • android 随机验证码 例子源码
    android 随机验证码 例子源码
    2014-11-07下载
    积分:1
  • Android图片资源批量重命名工具
        写这个东西主要是因为每次美工人员给我的PNG图的名字都是“设置36.PNG”、“设置48.PNG”、“设置72.PNG”这样“资源名+大小”的形式,并且放在同一个文件夹里,如果我直接把它重命名,就会出现文件名冲突;如果我把它放到不同文件夹再重命名,则翻来翻去的非常麻烦。这个工具就是为了批量重命名不同文件夹的类似名称图片资源文件。     使用本工具的步骤很简单,选择根目录,(对应APK中的“res”目录),按分析文件按钮,列出所有找到的文件名,然后在右侧文字框对应的行写上需要重命名的文件名(留空的行会跳过),再按批量改名按钮即可。重命名规则会保存在根目录下的“资源图片重命名.log”文件中。     注意事项:     一、只会重命名后缀名为“PNG”的图片文件;     二、只包括根目录下的第一层子目录,不包括根目录本身和更深层目录,目录名不限制;     三、分析和重命名时,自动忽略原图片文件名中的所有数字字符,所以不适合于原图片文件使用数字来区别的情况。
    2022-01-31 23:38:12下载
    积分:1
  • 696522资源总数
  • 104042会员总数
  • 46今日下载