Library that exposes the Datalogic Android SDK as a React Native module. It lets you receive barcode data from the scanner, as well as configure various scanner and device settings. It is available as a npm package for easy consumption here: @datalogic/react-native-datalogic-module.
You can use the plugin with either
npm, just make sure that the method is consistent across your project.
You can install the plugin using
yarn as follows:
You can install the plugin from the
npm registry as follows:
How can I create a React Native app that uses the Datalogic module?
Here's directions to create an app using
React Native that can receive barcode data, starting from scratch, without React Native already installed.
Create a directory for your app
Prepare your development environment for React Native
Visit https://reactnative.dev/docs/environment-setup and set up your React Native environment.
WARNING: If you plan on using Expo, take note that the managed workflow does NOT work with the React Native Datalogic module. Use either the 'React Native CLI Quickstart', or make sure you select the bare workflow option if using Expo.
Add datalogic module
Add barcode handling code
App.js. Add this line after your last
Next, add this code to a
componentWillMount() method before your return:
That's it. Start customizing your app to your liking. 🎉
Start app on device
How can I create an APK of my application?
When you've finished your app, heres how to create the AAB (Android App Bundle) and APK files.
Create the AAB
This will create the app-release.aab file which is now ready to be uploaded to Google Play. If you want to access the APK to use on other platforms, you will need to follow a few more steps to extract it from the AAB file.
Create the APK
Download Google bundletool and run the following command:
Change the file name from
.zip. Inside, the
universal.apk file is your app.