-
大小: 4.71MB文件類型: .rar金幣: 2下載: 0 次發布日期: 2023-09-21
- 語言: Java
- 標簽: 佳博??GprinterSDK??2.2??Android??
資源簡介
佳博 GprinterSDK 2.2 Android 最新SDK包 有心得有例子

代碼片段和文件信息
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
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????246234??2016-05-20?11:08??GprinterSDKForAndroid\api?docs.zip
?????文件????1036245??2015-03-11?15:34??GprinterSDKForAndroid\Gp2120TF中文編程手冊.pdf
?????文件?????982263??2015-03-11?15:34??GprinterSDKForAndroid\GP58中文編程手冊.pdf
?????文件?????175470??2016-06-23?09:14??GprinterSDKForAndroid\gprintersdkv22.jar
?????文件?????355002??2016-07-02?11:47??GprinterSDKForAndroid\GprinterSDK使用手冊.pdf
?????文件?????445680??2016-06-24?10:20??GprinterSDKForAndroid\GpService.aidl說明.pdf
?????文件????????491??2016-06-22?12:00??GprinterSDKForAndroid\工程Demo\GpSample\.classpath
?????文件?????????16??2016-06-21?12:49??GprinterSDKForAndroid\工程Demo\GpSample\.idea\.name
?????文件????????686??2016-06-21?12:48??GprinterSDKForAndroid\工程Demo\GpSample\.idea\compiler.xm
?????文件?????????76??2016-06-21?12:48??GprinterSDKForAndroid\工程Demo\GpSample\.idea\copyright\profiles_settings.xm
?????文件????????278??2016-06-21?12:49??GprinterSDKForAndroid\工程Demo\GpSample\.idea\libraries\gprintersdkv22.xm
?????文件????????667??2016-06-21?12:49??GprinterSDKForAndroid\工程Demo\GpSample\.idea\libraries\libs.xm
?????文件????????412??2016-06-21?12:49??GprinterSDKForAndroid\工程Demo\GpSample\.idea\libraries\_mylyn.xm
?????文件???????1993??2016-06-24?10:24??GprinterSDKForAndroid\工程Demo\GpSample\.idea\misc.xm
?????文件????????487??2016-06-21?12:49??GprinterSDKForAndroid\工程Demo\GpSample\.idea\modules.xm
?????文件???????8792??2016-06-21?12:53??GprinterSDKForAndroid\工程Demo\GpSample\.idea\uiDesigner.xm
?????文件????????164??2016-06-21?12:48??GprinterSDKForAndroid\工程Demo\GpSample\.idea\vcs.xm
?????文件??????60036??2016-06-25?16:59??GprinterSDKForAndroid\工程Demo\GpSample\.idea\workspace.xm
?????文件????????852??2016-05-05?09:57??GprinterSDKForAndroid\工程Demo\GpSample\.project
?????文件?????????57??2015-04-09?10:25??GprinterSDKForAndroid\工程Demo\GpSample\.settings\org.eclipse.core.resources.prefs
?????文件????????598??2016-04-19?08:51??GprinterSDKForAndroid\工程Demo\GpSample\.settings\org.eclipse.jdt.core.prefs
?????文件???????4733??2016-03-29?14:26??GprinterSDKForAndroid\工程Demo\GpSample\AndroidManifest.xm
?????文件?????????26??2016-03-22?15:05??GprinterSDKForAndroid\工程Demo\GpSample\assets\interval.properties
?????文件???????2110??2016-06-24?16:38??GprinterSDKForAndroid\工程Demo\GpSample\GpSample(客顯).iml
?????文件??????51394??2015-03-13?10:10??GprinterSDKForAndroid\工程Demo\GpSample\ic_launcher-web.png
?????文件?????424888??2016-07-11?10:03??GprinterSDKForAndroid\工程Demo\GpSample\libs\arm64-v8a\libgpequipment.so
?????文件??????21912??2016-07-11?10:03??GprinterSDKForAndroid\工程Demo\GpSample\libs\armeabi\libgpequipment.so
?????文件??????17824??2016-07-11?10:03??GprinterSDKForAndroid\工程Demo\GpSample\libs\armeabi-v7a\libgpequipment.so
?????文件?????174366??2016-07-02?11:49??GprinterSDKForAndroid\工程Demo\GpSample\libs\gprintersdkv22.jar
?????文件??????23630??2016-03-09?13:55??GprinterSDKForAndroid\工程Demo\GpSample\libs\jcc-bate-0.7.3.jar
............此處省略263個文件信息
評論
共有 條評論