protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); textViewStatus = FindViewById <TextView>(Resource.Id.PStextView); EMDKResults results = EMDKManager.GetEMDKManager(ApplicationContext, this); if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { textViewStatus.Text = string.Empty; textViewStatus.SetText("Status: " + "Failed in getEMDKManager::" + results.StatusCode, TextView.BufferType.Normal); } else { textViewStatus.Text = string.Empty; textViewStatus.SetText("Status: " + "getEMDKManager Success", TextView.BufferType.Normal); } addCrdInfoButtonListener(); addbtnUnlockButtonListener(); addFlashLedsButtonListener(); addFCCheckboxListener(); addDiagnosticButtonListener(); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); textViewData = FindViewById <TextView>(Resource.Id.textViewData) as TextView; textViewStatus = FindViewById <TextView>(Resource.Id.textViewStatus) as TextView; AddStartScanButtonListener(); AddStopScanButtonListener(); AddSpinnerScannersListener(); AddSpinnerTriggersListener(); AddCheckBoxContinuousListener(); AddCheckBoxDecodersListener(); PopulateTriggers(); // The EMDKManager object will be created and returned in the callback EMDKResults results = EMDKManager.GetEMDKManager(Application.Context, this); // Check the return status of GetEMDKManager if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { // EMDKManager object initialization success textViewStatus.Text = "Status: EMDKManager object creation failed."; } else { // EMDKManager object initialization failed textViewStatus.Text = "Status: EMDKManager object creation succeeded."; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); statusTextView = FindViewById <TextView>(Resource.Id.textViewStatus) as TextView; checkBoxCode128 = FindViewById <CheckBox>(Resource.Id.checkBoxCode128); checkBoxCode39 = FindViewById <CheckBox>(Resource.Id.checkBoxCode39); checkBoxEAN8 = FindViewById <CheckBox>(Resource.Id.checkBoxEAN8); checkBoxEAN13 = FindViewById <CheckBox>(Resource.Id.checkBoxEAN13); checkBoxUPCA = FindViewById <CheckBox>(Resource.Id.checkBoxUPCE); checkBoxUPCE0 = FindViewById <CheckBox>(Resource.Id.checkBoxUPCE0); // Set listener to the button AddSetButtonListener(); // The EMDKManager object will be created and returned in the callback EMDKResults results = EMDKManager.GetEMDKManager(Android.App.Application.Context, this); // Check the return status of processProfile if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { // EMDKManager object initialization success statusTextView.Text = "EMDKManager object creation failed ..."; } else { // EMDKManager object initialization failed statusTextView.Text = "EMDKManager object creation succeeded ..."; } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); EMDKResults result = EMDKManager.GetEMDKManager(Application.Context, this); if (result.StatusCode != EMDKResults.STATUS_CODE.Success) { Toast.MakeText(this, "Error opening the EMDK Manager", ToastLength.Long).Show(); } else { Toast.MakeText(this, "EMDK Manager is available", ToastLength.Long).Show(); } ScanReceiver _broadcastReceiver = new ScanReceiver(); global::Xamarin.Forms.Forms.Init(this, bundle); var my_application = new App(); _broadcastReceiver.scanDataReceived += (s, scanData) => { MessagingCenter.Send <App, string> (my_application, "ScanBarcode", scanData); }; // Register the broadcast receiver IntentFilter filter = new IntentFilter(ScanReceiver.IntentAction); filter.AddCategory(ScanReceiver.IntentCategory); Android.App.Application.Context.RegisterReceiver(_broadcastReceiver, filter); LoadApplication(my_application); }
public void OnOpened(EMDKManager emdkManagerInstance) { // This callback will be issued when the EMDK is ready to use. textViewStatus.Text = "Status: EMDK open success."; this.emdkManager = emdkManagerInstance; try { // Acquire the barcode manager resources barcodeManager = (BarcodeManager)emdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Barcode); if (barcodeManager != null) { // Add connection listener barcodeManager.Connection += barcodeManager_Connection; } // Enumerate scanner devices enumerateScanners(); // Set default scanner spinnerScanners.SetSelection(defaultIndex); // Set trigger (App default - HARD) spinnerTriggers.SetSelection(triggerIndex); } catch (Exception e) { textViewStatus.Text = "Status: BarcodeManager object creation failed."; Console.WriteLine("Exception:" + e.StackTrace); } }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Symbol.XamarinEMDK.SerialCommSample1.Resource.Layout.Main); editText = FindViewById <EditText>(Symbol.XamarinEMDK.SerialCommSample1.Resource.Id.editText1); editText.SetText("Serial Communication Write Data Testing.", EditText.BufferType.Normal); statusView = FindViewById <TextView>(Symbol.XamarinEMDK.SerialCommSample1.Resource.Id.statusView); statusView.SetText("", TextView.BufferType.Normal); statusView.RequestFocus(); EMDKResults results = EMDKManager.GetEMDKManager(ApplicationContext, this); if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { statusView.SetText("Failed to open EMDK", TextView.BufferType.Normal); } else { statusView.SetText("Opening EMDK...", TextView.BufferType.Normal); } addReadButtonEvents(); writeButtonEvents(); setEnabled(false); Activity = this; }
public void OnOpened(EMDKManager emdkManagerInstance) { // This callback will be issued when the EMDK is ready to use. textViewStatus.Text = "Status: EMDK open success."; this.emdkManager = emdkManagerInstance; try { // Acquire the barcode manager resources barcodeManager = (BarcodeManager)emdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Barcode); if (barcodeManager != null) { // Add connection listener barcodeManager.Connection += barcodeManager_Connection; } // Enumerate scanner devices EnumerateScanners(); // Set default scanner spinnerScannerDevices.SetSelection(defaultIndex); // Set trigger (App default - HARD) spinnerTriggers.SetSelection(triggerIndex); } catch (System.Exception e) { textViewStatus.Text = "Status: BarcodeManager object creation failed."; Console.WriteLine("Exception:" + e.StackTrace); } }
public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Log.Debug(TAG, "SSC onCreate"); // getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); results = EMDKManager.GetEMDKManager(Activity.ApplicationContext, this); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); EMDKResults results = EMDKManager.GetEMDKManager(Android.App.Application.Context, this); if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { ScannerStatus = "Status: EMDKManager object creation failed ..."; } else { ScannerStatus = "Status: EMDKManager object creation succeeded ..."; } Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); app = new App(); LoadApplication(app); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); Scanner = DependencyService.Get <ScannerService>(); var results = EMDKManager.GetEMDKManager(Android.App.Application.Context, Scanner); if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { //statusView.Text = "Status: EMDKManager object creation failed ..."; } else { //statusView.Text = "Status: EMDKManager object creation succeeded ..."; } //App application = new App(); App.Scanner = Scanner; LoadApplication(new App()); }
protected override void OnCreate(Bundle savedInstanceState) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar; base.OnCreate(savedInstanceState); EMDKResults result = EMDKManager.GetEMDKManager(Android.App.Application.Context, this); if (result.StatusCode != EMDKResults.STATUS_CODE.Success) { Toast.MakeText(this, "Error opening the EMDK Manager", ToastLength.Long).Show(); } else { Toast.MakeText(this, "EMDK Manager is available", ToastLength.Long).Show(); } _broadcastReceiver = new ScanReceiver(); Xamarin.Essentials.Platform.Init(this, savedInstanceState); global::Xamarin.Forms.Forms.Init(this, savedInstanceState); var my_application = new App(); _broadcastReceiver.scanDataReceived += (s, scanData) => { MessagingCenter.Send <App, string>(my_application, "ScanBarcode", scanData); }; LoadApplication(my_application); }
void EMDKManager.IEMDKListener.OnOpened(EMDKManager p0) { OnStatusChanged?.Invoke(this, new EMDKStatusChangedArgs("EMDK Opened successfully.")); m_EmdkManager = p0; InitScanner(); }
public override void OnDestroy() { base.OnDestroy(); Log.Debug(TAG, "SSC onDestroy"); if (selectedSimulScanReader != null) { selectedSimulScanReader.Data -= selectedSimulScanReader_Data; //selectedSimulScanReader.RemoveDataListener((SimulScanReader.IDataListerner)this); selectedSimulScanReader.Status -= selectedSimulScanReader_Status; //selectedSimulScanReader.RemoveStatusListener((SimulScanReader.IStatusListerner)this); } if (simulscanManager != null) { // simulscanManager.release(); emdkManager.Release(Symbol.XamarinEMDK.EMDKManager.FEATURE_TYPE.Simulscan); simulscanManager = null; } if (emdkManager != null) { emdkManager.Release(); emdkManager = null; } }
public void OnOpened(EMDKManager emdkManager) { mEmdkManager = emdkManager; String strStatus = ""; String[] modifyData = new String[1]; mProfileManager = (ProfileManager)mEmdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Profile); EMDKResults results = mProfileManager.ProcessProfile(mProfileName, ProfileManager.PROFILE_FLAG.Set, modifyData); if (results.StatusCode == EMDKResults.STATUS_CODE.Success) { strStatus = "Profile processed succesfully"; } else if (results.StatusCode == EMDKResults.STATUS_CODE.CheckXml) { //Inspect the XML response to see if there are any errors, if not report success using (XmlReader reader = XmlReader.Create(new StringReader(results.StatusString))) { String checkXmlStatus = "Status:\n\n"; while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: switch (reader.Name) { case "parm-error": checkXmlStatus += "Parm Error:\n"; checkXmlStatus += reader.GetAttribute("name") + " - "; checkXmlStatus += reader.GetAttribute("desc") + "\n\n"; break; case "characteristic-error": checkXmlStatus += "characteristic Error:\n"; checkXmlStatus += reader.GetAttribute("type") + " - "; checkXmlStatus += reader.GetAttribute("desc") + "\n\n"; break; } break; } } if (checkXmlStatus == "Status:\n\n") { strStatus = "Status: Profile applied successfully ..."; } else { strStatus = checkXmlStatus; } } } else { strStatus = "Something wrong on processing the profile"; } Toast.MakeText(this, strStatus, ToastLength.Long).Show(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_main); getImagesOferta(); buscarLoyal = (Button)FindViewById(Resource.Id.recompensa_btn); buscarLoyal.Click += dialogLoyal; EMDKResults results = EMDKManager.GetEMDKManager(Android.App.Application.Context, this); if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { ScannerStatus = "Status: EMDKManager object creation failed ..."; } else { ScannerStatus = "Status: EMDKManager object creation succeeded ..."; } StartTimer(); }
public void OnOpened(EMDKManager emdkManager) { ScannerStatus = "Status: EMDK Opened successfully ..."; this.emdkManager = emdkManager; InitScanner(); }
public override void OnViewCreated(View view, Bundle savedInstanceState) { base.OnViewCreated(view, savedInstanceState); menuRed = view.FindViewById <FloatingActionMenu> (Resource.Id.menu_red); fab1 = view.FindViewById <FloatingActionButton> (Resource.Id.fab1); fab2 = view.FindViewById <FloatingActionButton> (Resource.Id.fab2); fab3 = view.FindViewById <FloatingActionButton> (Resource.Id.fab3); statusView = view.FindViewById <TextView>(Resource.Id.statusView); dataView = view.FindViewById <TextView>(Resource.Id.DataView); ContextThemeWrapper context = new ContextThemeWrapper(this.Activity, Resource.Style.MenuButtonsStyle); FloatingActionButton programFab2 = new FloatingActionButton(context); EMDKResults results = EMDKManager.GetEMDKManager(Application.Context, this); if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { statusView.Text = "Status: EMDKManager object creation failed ..."; } else { statusView.Text = "Status: EMDKManager object creation succeeded ..."; } programFab2.LabelText = "Programmatically added button"; programFab2.SetImageResource(Resource.Drawable.ic_edit); fab1.Enabled = false; menuRed.SetOnMenuButtonClickListener(this); menuRed.SetClosedOnTouchOutside(true); menuRed.HideMenuButton(false); ; }
public void OnOpened(EMDKManager emdkManager) { Log.Debug(TAG, "onOpened"); textViewStatus.Text = "Status: " + "EMDK open success!"; this.emdkManager = emdkManager; simulscanManager = (SimulScanManager)this.emdkManager .GetInstance(Symbol.XamarinEMDK.EMDKManager.FEATURE_TYPE.Simulscan); if (null == simulscanManager) { Log.Error(TAG, "Get SimulScanManager instance failed!"); textViewStatus.Text = "Status: " + "Get SimulScanManager instance failed!"; return; } readerInfoList = simulscanManager.SupportedDevicesInfo; List <string> nameList = new List <string>(); foreach (SimulScanReaderInfo rinfo in readerInfoList) { nameList.Add(rinfo.FriendlyName); } addItemsOnSpinner(spinner2, nameList); spinner2.ItemSelected += spinner2_ItemSelected; readerIndex = 0; try { selectedSimulScanReader = simulscanManager.GetDevice((SimulScanReaderInfo)readerInfoList[readerIndex]); initCurrentScanner(); } catch (SimulScanException e) { // TODO Auto-generated catch block e.PrintStackTrace(); } }
private void initializeEMDK() { if (mEMDKManager == null) { EMDKResults results = null; try { //The EMDKManager object will be created and returned in the callback. results = EMDKManager.GetEMDKManager(mContext.ApplicationContext, mEMDKListener); } catch (Exception e) { logMessage("Error while requesting EMDKManager.\n" + e.Message, EMessageType.ERROR); return; } //Check the return status of EMDKManager object creation. if (results.StatusCode == EMDKResults.STATUS_CODE.Success) { logMessage("EMDKManager request command issued with success", EMessageType.DEBUG); } else { logMessage("EMDKManager request command error", EMessageType.ERROR); } } else { onEMDKManagerRetrieved(mEMDKManager); } }
private void DestroyScannerManager() { if (m_EmdkManager != null) { m_EmdkManager.Release(); m_EmdkManager = null; } }
public void OnOpened(EMDKManager emdkManager) { this.emdkManager = emdkManager; RunOnUiThread(() => { statusView.SetText("Application Initialized.", TextView.BufferType.Normal); }); }
public void OnClosed() { if (mEmdkManager != null) { mEmdkManager.Release(); mEmdkManager = null; } }
/// <summary> /// When Zebra scanner connection colses. /// </summary> public void OnClosed() { if (emdkManager != null) { emdkManager.Release(); emdkManager = null; } }
void EMDKManager.IEMDKListener.OnOpened(EMDKManager emdkManager) { statusView.Text = "Status: EMDK Opened successfully ..."; this.emdkManager = emdkManager; InitScanner(); }
public void OnOpened(EMDKManager manager) { _emdkManager = manager; // We can only initialize the barcode manager once we retrieve // the EMDK Manager, which is invoked by via callback in the // EMDK library InitializeBarcodeManager(); }
void InitializeEMDK(Context context) { var results = EMDKManager.GetEMDKManager(context, this); if (results.StatusCode != EMDKResults.STATUS_CODE.Success) { throw new InvalidOperationException("Unable to initialize EMDK Manager"); } }
void EMDKManager.IEMDKListener.OnClosed() { mProfileManager = null; if (mEmdkManager != null) { mEmdkManager.Release(); mEmdkManager = null; } }
public void OnClosed() { Log.Debug(TAG, "onClosed: EMDK closed unexpectedly"); emdkManager.Release(); emdkManager = null; textViewStatus.SetText("Status: " + "EMDK closed unexpectedly!", TextView.BufferType.Normal); }
public void OnClosed() { //This callback will be issued when the EMDK closes unexpectedly. if (emdkManager != null) { emdkManager.Release(); emdkManager = null; } }
void EMDKManager.IEMDKListener.OnClosed() { statusView.Text = "Status: EMDK Open failed unexpectedly. "; if (emdkManager != null) { emdkManager.Release(); emdkManager = null; } }
protected override void OnDestroy() { base.OnDestroy(); if (emdkManager != null) { // Clean up the objects created by EMDK manager emdkManager.Release(); emdkManager = null; } }
public void OnClosed() { // This callback will be issued when the EMDK closes unexpectedly. if (emdkManager != null) { emdkManager.Release(); emdkManager = null; } statusTextView.Text = "EMDK closed unexpectedly! Please close and restart the application."; }
private int triggerIndex = 0; // Keep the selected trigger #endregion Fields #region Methods public void OnClosed() { // This callback will be issued when the EMDK closes unexpectedly. if (emdkManager != null) { if (barcodeManager != null) { // Remove connection listener barcodeManager.Connection -= barcodeManager_Connection; barcodeManager = null; } // Release all the resources emdkManager.Release(); emdkManager = null; } textViewStatus.Text = "Status: EMDK closed unexpectedly! Please close and restart the application."; }
public void OnOpened(EMDKManager emdkManagerInstance) { // This callback will be issued when the EMDK is ready to use. statusTextView.Text = "EMDK open success."; this.emdkManager = emdkManagerInstance; try { // Get the ProfileManager object to process the profiles profileManager = (ProfileManager)emdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Profile); new ProcessProfileSetXMLTask().Execute(this); } catch (Exception e) { statusTextView.Text = "Error setting the profile."; Console.WriteLine("Exception:" + e.StackTrace); } }
public void OnOpened(EMDKManager emdkManager) { mEmdkManager = emdkManager; if (null == mScanner) { // Get Barcode Manager mBarcodeManager = (BarcodeManager)mEmdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Barcode); if (null == mBarcodeManager) { mStatusTextView.Text = "Impossible to get BarcodeManager handle"; return; } mScanner = mBarcodeManager.GetDevice(BarcodeManager.DeviceIdentifier.InternalImager1); if (null == mScanner) { mStatusTextView.Text = "Impossible to get Scanner handle"; return; } try { mScanner.AddDataListener(this); mScanner.AddStatusListener(this); mScanner.TriggerType = Scanner.TriggerTypes.Hard; mScanner.Enable(); mScanner.Read(); // Start an Async scann } catch (ScannerException e) { e.PrintStackTrace(); } Toast.MakeText(this, "Press Hard Scan Button to start scanning...", ToastLength.Long).Show(); } }
protected override void OnDestroy() { base.OnDestroy(); // De-initialize scanner deInitScanner(); // Clean up the objects created by EMDK manager if (barcodeManager != null) { // Remove connection listener barcodeManager.Connection -= barcodeManager_Connection; barcodeManager = null; } if (emdkManager != null) { emdkManager.Release(); emdkManager = null; } }
protected override void OnDestroy() { base.OnDestroy(); // Clean up the objects created by EMDK manager if (profileManager != null) { profileManager = null; } if (emdkManager != null) { emdkManager.Release(); emdkManager = null; } }
protected override void OnDestroy() { if (mEmdkManager != null) { mEmdkManager.Release(); mEmdkManager = null; } base.OnDestroy(); }