本文整理汇总了Java中no.nordicsemi.android.log.Logger.newSession方法的典型用法代码示例。如果您正苦于以下问题:Java Logger.newSession方法的具体用法?Java Logger.newSession怎么用?Java Logger.newSession使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类no.nordicsemi.android.log.Logger
的用法示例。
在下文中一共展示了Logger.newSession方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(final BluetoothDevice device, final String name) {
final int titleId = getLoggerProfileTitle();
if (titleId > 0) {
mLogSession = Logger.newSession(getApplicationContext(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
if (mLogSession == null && getLocalAuthorityLogger() != null) {
mLogSession = LocalLogSession.newSession(getApplicationContext(), getLocalAuthorityLogger(), device.getAddress(), name);
}
}
mDeviceName = name;
mBleManager.setLogger(mLogSession);
mDeviceNameView.setText(name != null ? name : getString(R.string.not_available));
mConnectButton.setText(R.string.action_disconnect);
mBleManager.connect(device);
}
示例2: onCreate
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mLogSession = Logger.newSession(this, "Hello", "BleUARTPeripheral");
setContentView(R.layout.activity_main);
ListView list = new ListView(this);
setContentView(list);
mConnectedDevices = new ArrayList<BluetoothDevice>();
mConnectedDevicesAdapter = new ArrayAdapter<BluetoothDevice>(this,
android.R.layout.simple_list_item_1, mConnectedDevices);
list.setAdapter(mConnectedDevicesAdapter);
mBluetoothManager = (BluetoothManager) getSystemService(BLUETOOTH_SERVICE);
mBluetoothAdapter = mBluetoothManager.getAdapter();
Logger.log(mLogSession, LogContract.Log.Level.DEBUG, "In on create");
}
示例3: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(final BluetoothDevice device, final String name) {
final int titleId = getLoggerProfileTitle();
if (titleId > 0) {
mLogSession = Logger.newSession(getApplicationContext(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
if (mLogSession == null && getLocalAuthorityLogger() != null) {
mLogSession = LocalLogSession.newSession(getApplicationContext(), getLocalAuthorityLogger(), device.getAddress(), name);
}
}
mDeviceName = name;
mDeviceNameView.setText(name != null ? name : getString(R.string.not_available));
mConnectButton.setText(R.string.action_disconnect);
// The device may not be in the range but the service will try to connect to it if it reach it
Logger.d(mLogSession, "Creating service...");
final Intent service = new Intent(this, getServiceClass());
service.putExtra(BleProfileService.EXTRA_DEVICE_ADDRESS, device.getAddress());
if (mLogSession != null)
service.putExtra(BleProfileService.EXTRA_LOG_URI, mLogSession.getSessionUri());
startService(service);
Logger.d(mLogSession, "Binding to the service...");
bindService(service, mServiceConnection, 0);
}
示例4: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(final BluetoothDevice device, final String name) {
final int titleId = getLoggerProfileTitle();
if (titleId > 0) {
mLogSession = Logger.newSession(getApplicationContext(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
if (mLogSession == null && getLocalAuthorityLogger() != null) {
mLogSession = LocalLogSession.newSession(getApplicationContext(), getLocalAuthorityLogger(), device.getAddress(), name);
}
}
mBluetoothDevice = device;
mDeviceName = name;
// The device may not be in the range but the service will try to connect to it if it reach it
Logger.d(mLogSession, "Creating service...");
final Intent service = new Intent(this, getServiceClass());
service.putExtra(BleProfileService.EXTRA_DEVICE_ADDRESS, device.getAddress());
service.putExtra(BleProfileService.EXTRA_DEVICE_NAME, name);
if (mLogSession != null)
service.putExtra(BleProfileService.EXTRA_LOG_URI, mLogSession.getSessionUri());
startService(service);
Logger.d(mLogSession, "Binding to the service...");
bindService(service, mServiceConnection, 0);
}
示例5: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(BluetoothDevice device, String name) {
final int titleId = getLoggerProfileTitle();
if (titleId > 0) {
mLogSession = Logger.newSession(getActivity().getApplicationContext(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
if (mLogSession == null && getLocalAuthorityLogger() != null) {
mLogSession = LocalLogSession.newSession(getActivity().getApplicationContext(), getLocalAuthorityLogger(), device.getAddress(), name);
}
}
// The device may not be in the range but the service will try to connect to it if it reach it
Logger.d(mLogSession, "Creating service...");
final Intent service = new Intent(getActivity(), getServiceClass());
service.putExtra(BleProfileService.EXTRA_DEVICE_ADDRESS, device.getAddress());
if (mLogSession != null)
service.putExtra(BleProfileService.EXTRA_LOG_URI, mLogSession.getSessionUri());
getActivity().startService(service);
Logger.d(mLogSession, "Binding to the service...");
getActivity().bindService(service, mServiceConnection, 0);
}
示例6: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(final BluetoothDevice device, final String name) {
final int titleId = getLoggerProfileTitle();
if (titleId > 0) {
mLogSession = Logger.newSession(getApplicationContext(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
if (mLogSession == null && getLocalAuthorityLogger() != null) {
mLogSession = LocalLogSession.newSession(getApplicationContext(), getLocalAuthorityLogger(), device.getAddress(), name);
}
}
mDeviceNameView.setText(mDeviceName = name);
mConnectButton.setText(R.string.action_disconnect);
// The device may not be in the range but the service will try to connect to it if it reach it
Logger.d(mLogSession, "Creating service...");
final Intent service = new Intent(this, getServiceClass());
service.putExtra(BleProfileService.EXTRA_DEVICE_ADDRESS, device.getAddress());
if (mLogSession != null)
service.putExtra(BleProfileService.EXTRA_LOG_URI, mLogSession.getSessionUri());
startService(service);
Logger.d(mLogSession, "Binding to the service...");
bindService(service, mServiceConnection, 0);
}
示例7: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(final BluetoothDevice device, final String name) {
final int titleId = getLoggerProfileTitle();
ILogSession logSession = null;
if (titleId > 0) {
logSession = Logger.newSession(getApplicationContext(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
if (logSession == null && getLocalAuthorityLogger() != null) {
logSession = LocalLogSession.newSession(getApplicationContext(), getLocalAuthorityLogger(), device.getAddress(), name);
}
}
mService.connect(device, logSession);
}
开发者ID:NordicSemiconductor,项目名称:Android-nRF-Toolbox,代码行数:15,代码来源:BleMulticonnectProfileServiceReadyActivity.java
示例8: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(final BluetoothDevice device, final String name) {
final int titleId = getLoggerProfileTitle();
if (titleId > 0) {
mLogSession = Logger.newSession(getApplicationContext(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
if (mLogSession == null && getLocalAuthorityLogger() != null) {
mLogSession = LocalLogSession.newSession(getApplicationContext(), getLocalAuthorityLogger(), device.getAddress(), name);
}
}
mDeviceName = name;
mBleManager.setLogger(mLogSession);
mBleManager.connect(device);
}
开发者ID:NordicSemiconductor,项目名称:Android-nRF-Toolbox,代码行数:15,代码来源:BleProfileExpandableListActivity.java
示例9: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(BluetoothDevice device, String name) {
final int titleId = R.string.hrs_feature_title;
if (titleId > 0) {
mLogSession = Logger.newSession(BleApplication.getInstance(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
}
mBleManager.setLogger(mLogSession);
mBleManager.connect(device);
}
示例10: onDeviceSelected
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
@Override
public void onDeviceSelected(final BluetoothDevice device, final String name) {
final int titleId = getLoggerProfileTitle();
if (titleId > 0) {
mLogSession = Logger.newSession(getApplicationContext(), getString(titleId), device.getAddress(), name);
// If nRF Logger is not installed we may want to use local logger
if (mLogSession == null && getLocalAuthorityLogger() != null) {
mLogSession = LocalLogSession.newSession(getApplicationContext(), getLocalAuthorityLogger(), device.getAddress(), name);
}
}
mBleManager.setLogger(mLogSession);
mDeviceNameView.setText(mDeviceName = name);
mConnectButton.setText(R.string.action_disconnect);
mBleManager.connect(device);
}
示例11: connect
import no.nordicsemi.android.log.Logger; //导入方法依赖的package包/类
/**
* Connect to peripheral
*/
public void connect(final ExtendedBluetoothDevice device) {
final LogSession logSession = Logger.newSession(getApplication(), null, device.getAddress(), device.getName());
mBlinkyManager.setLogger(logSession);
mBlinkyManager.connect(device.getDevice());
}