Skip to content
Advertisement

How to Test EMDK functionality on traditional android Device?

So I’ve been stuck for a while, scratching my head around, I don’t know how to test my application on Emulator or on my testing android device, when I try to run the application it gives an error on installation

09/02 14:17:01: Launching ‘app’ on Pixel API 24. Installation did not succeed. The application could not be installed: INSTALL_FAILED_MISSING_SHARED_LIBRARY

List of apks: [0] ‘/home/username/AndroidStudioProjects/projectName/app/build/outputs/apk/debug/app-debug.apk’ Installation failed due to: ‘null’ Retry

Solutions Tried

Stackoverflow Link to the possible solution

Advertisement

Answer

After an Intensive search and many failures, I came across a solution which is not a final solution but a workaround for testing EMDK application, during its development phases. It’s hard for newbies, but it will make sense if you have prior knowledge of Instrumental Testing using JUNIT.

Instrumented Testing

//  Simulate a barcode being scanned
mockedInterface.AddScanData(ā€œ123456789ā€);
ScanDataCollection scanDataCollection = mockedInterface.ReportScan(success);

Pass Test Data

//  Trigger the data listener
activity.onData(scanDataCollection);

Check credibility of data

 //  Test that the correct data was scanned
onView(withId(R.id.textViewData)).check(matches(withText(ā€0123456789nā€)));

Github link to sample Project: Github

Link to Original Source: Original Source

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement