资源简介
android 蓝牙SPP传输demo(代码),可以调用android蓝牙SPP数据,接口设置等
android 蓝牙SPP传输demo(代码),可以调用android蓝牙SPP数据,接口设置等
代码片段和文件信息
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed 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.
*/
package com.example.android.BluetoothChat;
import android.app.ActionBar;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.Window;
import android.view.View.onclickListener;
import android.view.inputmethod.EditorInfo;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
/**
* This is the main Activity that displays the current chat session.
*/
public class BluetoothChat extends Activity {
// Debugging
private static final String TAG = “BluetoothChat“;
private static final boolean D = true;
// Message types sent from the BluetoothChatService Handler
public static final int MESSAGE_STATE_CHANGE = 1;
public static final int MESSAGE_READ = 2;
public static final int MESSAGE_WRITE = 3;
public static final int MESSAGE_DEVICE_NAME = 4;
public static final int MESSAGE_TOAST = 5;
// Key names received from the BluetoothChatService Handler
public static final String DEVICE_NAME = “device_name“;
public static final String TOAST = “toast“;
// Intent request codes
private static final int REQUEST_CONNECT_DEVICE_SECURE = 1;
private static final int REQUEST_CONNECT_DEVICE_INSECURE = 2;
private static final int REQUEST_ENABLE_BT = 3;
// Layout Views
private ListView mConversationView;
private EditText mOutEditText;
private Button mSendButton;
// Name of the connected device
private String mConnectedDeviceName = null;
// Array adapter for the conversation thread
private ArrayAdapter mConversationArrayAdapter;
// String buffer for outgoing messages
private StringBuffer mOutStringBuffer;
// Local Bluetooth adapter
private BluetoothAdapter mBluetoothAdapter = null;
// Member object for the chat services
private BluetoothChatService mChatService = null;
@Override
public void onCreate(Bundle savedInstanceState) {
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1804 2013-04-30 01:52 android bluetooth spp\BluetoothChat\AndroidManifest.xm
文件 4182 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\drawable\app_icon.png
文件 5589 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\drawable-hdpi\app_icon.png
文件 1532 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\layout\custom_ti
文件 2158 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\layout\device_list.xm
文件 876 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\layout\device_name.xm
文件 1744 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\layout\main.xm
文件 876 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\layout\message.xm
文件 1364 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\menu\option_menu.xm
文件 1976 2013-04-30 01:52 android bluetooth spp\BluetoothChat\res\values\strings.xm
文件 13775 2013-04-30 01:52 android bluetooth spp\BluetoothChat\src\com\example\android\BluetoothChat\BluetoothChat.java
文件 17971 2013-04-30 01:52 android bluetooth spp\BluetoothChat\src\com\example\android\BluetoothChat\BluetoothChatService.java
文件 7959 2013-04-30 01:52 android bluetooth spp\BluetoothChat\src\com\example\android\BluetoothChat\DeviceListActivity.java
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\src\com\example\android\BluetoothChat
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\src\com\example\android
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\src\com\example
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\res\drawable
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\res\drawable-hdpi
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\res\layout
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\res\menu
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\res\values
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\src\com
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\res
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat\src
目录 0 2013-09-16 03:33 android bluetooth spp\BluetoothChat
目录 0 2016-01-20 17:11 android bluetooth spp
----------- --------- ---------- ----- ----
61806 26
- 上一篇:java海量数据读写优化方案
- 下一篇:用编译原理知识编写的计算器
相关资源
- Android代码-多功能拨号盘源码.zip
- printershare直接破解版--11.5(适配andr
- android RDP远程桌面客户端源码
- 手机远程控制手机android
- spring boot+ios app+android app 即时通讯项目
- Androidrepo文件
- Aandroid 多线程断点续传同时多个大文
- Vue项目实现手机端上传图片,使用于
- Android多文件断点续传
- Android多线程文件夹及断点续传
- android 安卓 FTP 文件 管理
- Android-5.1.1_r1源码.7z
- mac版adb工具
- NFC Card万能读卡android程序
- Android直连Mysql数据库需要导入的jar包
- android实现谷歌地图项目
- Android日历239876
- 主页面框架
- Android双列滑动表格(双表头不动)
- android绘制心电图
- Android安卓中文API开发文档参考手册官
- Android开发的UI图标大全
- Crypto++ 7.0.0 for Android 已编译
- Android手机通过otg线外接usb摄像头
- AndroidStudio使用svn第一次提交忽略文件
- Android编程设计模式之原型模式详解
- 浅谈Android客户端与服务器的数据交互
- 基于android框架的客户端和基于java服务
- 好用的支持android 6.0以上的libserial_p
- AndroidStudio插件配置
评论
共有 条评论