Device boot broadcast event

K Kishor PV 3 years ago
28 2 0

HI,
 
I'm trying to receive a broadcast event up on device boot(Reboot). I tried most combinations of the below intent filter types but it's never been a consistant. I'm logging and inserting few things to content provider within this receiver and I don't see it's working as expected. Is there any custom action intent filter I need to use? I noticed with few custom intent filters with few vendors.
 
I didn't see any exceptions in the console.
 

 
 
 
 
 

 
Thanks,
Kishor PV

Please register or login to post a reply

2 Replies

K Kishor PV

HI Bill,

I'm releasing the scanner resources when the app goes to background(On pause) but I keep seeing the below set of exceptions when I just start the app and move it to back ground.

Exceptions:

com.symbol.emdk.barcode.ScannerException: Scan read is issued without adding the data listener.
Already scanning. Wait for current scanning to complete.
com.symbol.emdk.barcode.ScannerException: The scanner device is not enabled.

Method:

@Overridepublic void onStatus(StatusData statusData) {
  StatusData.ScannerStates state = statusData.getState();
  Log.d("scannerstatus", state.name());

   switch (state) {
   case IDLE:
   isScanning = false;
   try {

  ScannerConfig config = scanner.getConfig();

  config.decoderParams.upce0.enabled = true;
  config.decoderParams.upce0.reportCheckDigit = true;
  config.decoderParams.upce0.preamble = ScannerConfig.Preamble.SYS_CHAR;

  config.decoderParams.upce1.enabled = true;
  config.decoderParams.upce1.reportCheckDigit = true;
  config.decoderParams.upce1.preamble = ScannerConfig.Preamble.SYS_CHAR;

   if (this.isListenersAttached && scanner.isEnabled()) {
   scanner.setConfig(config);
   scanner.read();
  }

  } catch (ScannerException e) {
  e.printStackTrace();
  }
   break;
   case SCANNING:
   isScanning = true;
   break;
   case WAITING:
   break;
   case DISABLED:
   break;
   case ERROR:
   break;
   default:
   break;
  }
}

Steps:

*After the initialising scanner and getting the home screen (hope fully scanner is in idle state).
* Try to tap on the menu button so that app goes to background.
* Exceptions in logs.

I guess when the app goes to background scanner is trying to read and at the same time I'm releasing the emdk manager and scanner resources.

Appreciate if you respond.

V Vedsatx Saddvv

Hey Kishor,
Make sure to request permission in your manifest.

Also, your App must be launched at least one time by the user before your app will receive that broadcast at boot.

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