Search code examples
androidshared-librariesmotorola-emdk

EMDK user library optional load for Android


I have an application to read barcodes. This application can be used with an Zebra device with its integrated reader connected with API but also with a common Android device with a camera.

The problem is that I get this error

Installation did not succeed.
The application could not be installed: INSTALL_FAILED_MISSING_SHARED_LIBRARY

When installing the application in a non-Zebra device.

It is possible to set the library as optional to avoid the double compilation (with/without third paty library)?


Solution

  • Yes, you can specify the library as optional and you also need to ensure you do not instantiate a class that extends the EMDKListener on a non-Zebra device or you will get a crash. I have an example of an app that uses the EMDK on Zebra devices but also runs on non-Zebra devices, https://github.com/darryncampbell/WakeLock_WifiLock_Exerciser/tree/master/WakeLock_WifiLock_Exerciser. It does not use the EMDK for scanning but hopefully you can see the principle - the MainActivity.java has a test whether the EMDK is available