当前位置: 首页>>代码示例>>Java>>正文


Java RemoteDevice类代码示例

本文整理汇总了Java中it.gerdavax.easybluetooth.RemoteDevice的典型用法代码示例。如果您正苦于以下问题:Java RemoteDevice类的具体用法?Java RemoteDevice怎么用?Java RemoteDevice使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


RemoteDevice类属于it.gerdavax.easybluetooth包,在下文中一共展示了RemoteDevice类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getView

import it.gerdavax.easybluetooth.RemoteDevice; //导入依赖的package包/类
public View getView(int position, View convertView, ViewGroup parent) {
	LinearLayout view = null;

	if (convertView == null) {
		view = new LinearLayout(DeviceDiscovery.this);
		String inflater = Context.LAYOUT_INFLATER_SERVICE;
		LayoutInflater vi = (LayoutInflater) DeviceDiscovery.this.getSystemService(inflater);
		vi.inflate(R.layout.discovered_devices_list_item, view, true);
	} else {
		view = (LinearLayout) convertView;
	}

	TextView addressTextView = (TextView) view.findViewById(R.id.device_address);
	TextView nameTextView = (TextView) view.findViewById(R.id.device_name);
	
	RemoteDevice device = discoveredDevices.get(position);
	String address = device.getAddress();
	String name = device.getFriendlyName();
	
	addressTextView.setText(address);
	nameTextView.setText((name==null) ? "NONAME" : name);

	return view;
}
 
开发者ID:abraxasson,项目名称:amarino,代码行数:25,代码来源:DeviceDiscovery.java

示例2: connect

import it.gerdavax.easybluetooth.RemoteDevice; //导入依赖的package包/类
protected void connect(final String address){
	if (address == null) return;
	localDevice = LocalDevice.getInstance();
	localDevice.init(this, new ReadyListener() {
		@Override
		public void ready() {
			RemoteDevice device = localDevice.getRemoteForAddr(address);
			localDevice.destroy();
			new ConnectThread(device).start();
		}
	});
	
}
 
开发者ID:abraxasson,项目名称:amarino,代码行数:14,代码来源:AmarinoService.java

示例3: onStart

import it.gerdavax.easybluetooth.RemoteDevice; //导入依赖的package包/类
@Override
protected void onStart() {
	super.onStart();

       localDevice.init(this, new ReadyListener(){

       	@Override
		public void ready() {
			localDevice.scan(new ScanListener(){
				
				@Override
				public void deviceFound(RemoteDevice device) {
					
					synchronized(adapter.discoveredDevices){
						Vector<RemoteDevice> addedDevices = adapter.discoveredDevices;
						for (RemoteDevice rd : addedDevices){
							if (rd.getAddress().equals(device.getAddress())){
								Log.d(TAG, "device already in list -> renew");
								adapter.discoveredDevices.remove(rd);
							}
						}
						adapter.discoveredDevices.add(device);
					}
					adapter.notifyDataSetChanged();
				}

				@Override
				public void scanCompleted() {
					setProgressBarIndeterminateVisibility(false);
				}
			});
		} // end ready()
       });
       
}
 
开发者ID:abraxasson,项目名称:amarino,代码行数:36,代码来源:DeviceDiscovery.java

示例4: onListItemClick

import it.gerdavax.easybluetooth.RemoteDevice; //导入依赖的package包/类
@Override
protected void onListItemClick(ListView lv, View view, int position, long id) {
	super.onListItemClick(lv, view, position, id);
	// since user selected already a device we do not need to scan for more devices
	localDevice.stopScan();
	
	final String address = ((RemoteDevice)adapter.getItem(position)).getAddress();
	Intent i = new Intent();
	i.putExtra(ADDRESS_EXTRA, address);
	setResult(RESULT_OK, i);
	finish();
}
 
开发者ID:abraxasson,项目名称:amarino,代码行数:13,代码来源:DeviceDiscovery.java

示例5: ConnectThreadArduino

import it.gerdavax.easybluetooth.RemoteDevice; //导入依赖的package包/类
public ConnectThreadArduino(RemoteDevice device) {
    mDevice = device;
    Log.d("Shimmer", " Start of ArduinoConnectThread");
}
 
开发者ID:gradlman,项目名称:SensorLib,代码行数:5,代码来源:Shimmer.java

示例6: ConnectThread

import it.gerdavax.easybluetooth.RemoteDevice; //导入依赖的package包/类
public ConnectThread(RemoteDevice device) {
    mDevice = device;
}
 
开发者ID:abraxasson,项目名称:amarino,代码行数:4,代码来源:AmarinoService.java

示例7: BTDevice

import it.gerdavax.easybluetooth.RemoteDevice; //导入依赖的package包/类
public BTDevice(RemoteDevice rd){
	this.address = rd.getAddress();
	this.name = rd.getFriendlyName();
}
 
开发者ID:abraxasson,项目名称:amarino,代码行数:5,代码来源:BTDevice.java


注:本文中的it.gerdavax.easybluetooth.RemoteDevice类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。