Barcode API - very slow

P Petr Brant 3 years 4 months ago
31 1 0

Good morning,
 
we have Android Xamarin application with Barcode Scanner API. On every Activity we have InitScanner method OnResume event and DeinitScanner method on OnPause event.
 
public void InitScanner(bool enableScannerOnStartup) {     if (emdkManager != null)     {         if (barcodeManager == null)         {             try             {                 barcodeManager = (BarcodeManager) emdkManager.GetInstance(EMDKManager.FEATURE_TYPE.Barcode);                 scanner = barcodeManager.GetDevice(BarcodeManager.DeviceIdentifier.Default);                 if (scanner != null)                 {                     scanner.Data += scanner_Data;                     scanner.Enable();                 }             }             catch (ScannerException e)             {                 //LOG             }             catch (Exception e)             {                 //LOG             }         }     } }public void DeinitScanner() {     if (emdkManager != null)     {         if (scanner != null)         {             try             {                 scanner.Data -= scanner_Data;                 scanner.Status -= scanner_Status;                 scanner.Disable();             }             catch (ScannerException e)             {                 //LOG             }         }         if (barcodeManager != null)         {             emdkManager.Release(EMDKManager.FEATURE_TYPE.Barcode);         }         barcodeManager = null;         scanner = null;     } } 
 
InitScanner and DeinitScanner is called for every Activity. We have problem with speed (Init takes aproximately 4 seconds - on every StartActivity). What is the best solution how to speed up application (BarcodeAPI, DataWedge profile, create scanner singleton)?
 
Thank you for advice.

Please Register or Login to post a reply

1 Replies

E Efkan YILMAZ

Hello Petr,
     Sorry for the delay in answering your question. Could you provide a full sample app that displays this issue? A full sample will help greatly in tracking down the issue.

CONTACT
Can’t find what you’re looking for?