public PrinterOnAndroid(string deviceIdentifier) { _deviceIdentifier = deviceIdentifier; _mobile = SESLib.Create(_deviceIdentifier); _mobile.Connect(); _mobile.SetTimeout(DEFAULT_TIMEOUT); }
/// <summary> /// Create JetadvantageLinkUI object and connect to Android /// </summary> /// <param name="device"></param> /// <exception cref="DeviceCommunicationException">thrown when can not connect to Link UI</exception> public JetAdvantageLinkUI(IDevice device) { Address = device.Address; try { JetAdvantageLinkLogAdapter.Attach(); } catch { // Consume exception here. } Controller = SESLib.Create(Address); if (Controller == null) { throw new DeviceCommunicationException($"Can not connect to the Link UI on device at {device.Address}."); } if (!Controller.Connect(true, true)) { throw new DeviceCommunicationException($"Can not start SES Agent on device at {device.Address}"); } }
/// <summary> /// Initializes a new instance of the <see cref="AndroidAppManagerBase"/> class. /// </summary> /// <param name="pluginExecutionData"></param> /// <param name="activityData"></param> public AndroidAppManagerBase(PluginExecutionData pluginExecutionData, HpRoamActivityData activityData) { try { _executionData = pluginExecutionData; _activityData = activityData; _controller = SESLib.Create(_activityData.MobileEquipmentId); _controller.Connect(false, true); _androidHelper = new AndroidHelper(_controller); _controller.PressKey(KeyCode.KEYCODE_WAKEUP); //Power Button _controller.PressKey(KeyCode.KEYCODE_HOME); if (_androidHelper.ExistResourceId("com.android.systemui:id/keyguard_indication_area")) { _controller.Swipe(SESLib.To.Up); } } catch (NullReferenceException ex) { throw new DeviceWorkflowException($"Unable to connect to the android phone using the connection ID {_activityData.MobileEquipmentId}.", ex); } }