-
大小: 4.4MB文件类型: .7z金币: 2下载: 1 次发布日期: 2023-09-18
- 语言: Java
- 标签: GprinterSDK Android
资源简介
GprinterSDK for Android
佳博打印机 2.2.7.7 sdk for Android,支持usb,蓝牙,wifi连接打印,有使用佳博票据打印机开发的可以参考
代码片段和文件信息
package com.gprinter.sample;
import java.util.Set;
import com.sample.R;
import android.app.Activity;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.onclickListener;
import android.view.Window;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
public class BluetoothDeviceList extends Activity {
// Debugging
private static final String DEBUG_TAG = “DeviceListActivity“;
public static LinearLayout deviceNamelinearLayout;
// Member fields
private ListView lvPairedDevice = null lvNewDevice = null;
private TextView tvPairedDevice = null tvNewDevice = null;
private Button btDeviceScan = null;
private BluetoothAdapter mBluetoothAdapter;
private ArrayAdapter mPairedDevicesArrayAdapter;
private ArrayAdapter mNewDevicesArrayAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
// requestWindowFeature(Window.FEATURE_CUSTOM_title);
setContentView(R.layout.dialog_bluetooth_list);
Log.e(DEBUG_TAG “On Create“);
// TextView �����?
tvPairedDevice = (TextView)findViewById(R.id.tvPairedDevices);
//ListView �����?
lvPairedDevice = (ListView)findViewById(R.id.lvPairedDevices);
// TextView �µ�
tvNewDevice = (TextView)findViewById(R.id.tvNewDevices);
// ListView �µ�
lvNewDevice = (ListView)findViewById(R.id.lvNewDevices);
// Button ɨ���豸
btDeviceScan = (Button)findViewById(R.id.btBluetoothScan);
btDeviceScan.setonclickListener(new onclickListener(){
@Override
public void onclick(View v) {
// TODO Auto-generated method stub
v.setVisibility(View.GONE);
discoveryDevice();
}
});
getDeviceList();
}
@Override
protected void onDestroy() {
super.onDestroy();
// Make sure we‘re not doing discovery anymore
if (mBluetoothAdapter != null) {
mBluetoothAdapter.cancelDiscovery();
}
// Unregister broadcast listeners
if(mFindBlueToothReceiver != null)
this.unregisterReceiver(mFindBlueToothReceiver);
}
protected void getDeviceList() {
// Initialize array adapters. One for already paired devices and
// one for newly discovered devices
mPairedDevicesArrayAdapter = new ArrayAdapter(this
R.layout.bluetooth_device_name_item);
mNewDevicesArrayAdapter = new ArrayAdapter(this
R.layout.bluetooth_de
- 上一篇:数据结构java版 刘小晶
- 下一篇:java 缓存 cache lru
相关资源
- 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插件配置
评论
共有 条评论