Barcode Scanner App with Visual Studio & Cordova
This demo utilizes Cordova's <a href=https://github.com/wildabeast/BarcodeScanner"">barcode plugin, KnockoutJS and a RESTful Service from Outpan.com to gather Product information.
We, at advarics GmbH, use similar techniques plus some UI-frameworks, like Telerik's Kendo or DevExpress, to provide our customers instant information regarding their products & sales. This example wants to show how quickly one can develop a barcode scanner without touching the device-specific languages (Java, Objective-C) and environments (Android, iOS).
Thanks to Cordova and Microsoft's Visual Studio Tools the development of mobile apps is straightforward and easy. Of course, the current VS Tools are in CTP and I encountered some problems while trying to run the App in the Android emulator. However, I expect them to disappear when the final version arrives.
Prerequisites: API-Key
To be able to use the Product-Service from Outpan.com a valid (free) registration is needed. After the registration the generated API-Key should be inserted in scripts/modules/scanner.js
To compile the solution VS 2013 Tools for Apache Cordova - CTP3 must be installed.
This installer will download the Cordova runtime, SDKs etc. If you already have the Android SDKs/NDKs you can change their paths in:
Tools/Options/Tools for Apache Cordova
Ripple Emulator
VS2013 Tools for Cordova include the browser-based Ripple-Emulator which can emulate many different devices & form factors.
This is the app in Ripple
Important: the activated proxy in Ripple can cause connectivity problems. In such cases one can disable it under Settings/Cross Domain Proxy
Plugin installation
The default project settings contain no Barcode scanner plugin. But this can be changed very easily by selecting the config.xml. In the new window open the Plugins section and select Tab Custom
Here the plugin can be installed as a local file or via its GitHub URL.
Running in Android Emulator
Currently, it is not possible to run this App in the Emulator. A problem with q.js under node_modules throws an exception that halts the App execution.
Luckilly, manual compiling an deployment to a real device is still possible. Via Console go to Cordova's build directory and execute the build.bat to generate a new APK package.
*Cordova's Build Directory with build- & run-Scripts* *Executing build.bat*Deploying APK to device
Before executing run.bat the attached Android device must activate its Developer Options. These settings allow the installation of unsigned APK packages. More info here.
Final result
License
MIT