How to Integrate Zebra Android EMDK/SDK in a Flutter App

Using platform channels, learn how to integrate Zebra Android EMDK or SDK into your Flutter app. A complete guide for developers working with enterprise mobility solutions.

Jun 26, 2025 - 13:06
 8
How to Integrate Zebra Android EMDK/SDK in a Flutter App

Flutter is an increasingly popular mobile development framework thanks to its ability to write once and deploy to both Android and iOS. However, when dealing with hardware-specific SDKs like Zebras EMDK (Enterprise Mobility Development Kit), Flutter developers may encounter challenges due to limited direct support. Several Companies like SGV SoftTech, Wipro, etc, are experts in Flutter Development.

This guide will walk through how to integrate Zebras Android EMDK or SDK into a Flutter application using platform channels a native communication bridge in Flutter that allows developers to write native Android code and connect it with Dart.

Why Zebra EMDK?

Zebras EMDK provides powerful tools for barcode scanning, RFID, and other device-specific capabilities tailored for enterprise use. However, its designed for native Android development (Java/Kotlin), and not directly supported in Flutter. Thats where platform channels come in.

Integration Strategy: Flutter + Native Android (EMDK)

Flutter uses platform channels to communicate with native code. This enables developers to use the Zebra SDK in a native Android module and interact with it via Dart.

1. Set Up Your Flutter Project

Start by creating a new Flutter app:

bash
flutter create zebra_emdk_flutter cd zebra_emdk_flutter

Open the project in your IDE and focus on the Android part inside /android/app.

2. Add EMDK Dependencies in Native Android

Open android/app/build.gradle and add Zebras EMDK library dependencies. Youll need to download the EMDK SDK from Zebras developer portal and follow their instructions for importing the library manually or through Maven.

gradle
dependencies { implementation files('libs/EMDK-AAR.aar') }

Also, make sure the AndroidManifest.xml Includes necessary permissions:

xml
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.CAMERA"/>

And register Zebras required services:

xml
<application> <service android:name="com.symbol.emdk.EMDKService" /> </application>

3. Implement EMDK Logic in Kotlin/Java

Inside the Android module, create a class (e.g., EMDKHandler.kt) that initializes the EMDK and listens for scanning events or device configurations.

Basic structure for initializing EMDK:

kotlin
class EMDKHandler: EMDKManager.EMDKListener { private var emdkManager: EMDKManager? = null fun initialize(context: Context) { EMDKManager.getEMDKManager(context, this) } override fun onOpened(manager: EMDKManager?) { emdkManager = manager // Initialize profile manager or scanner manager } override fun onClosed() { emdkManager?.release() } }

4. Create a Platform Channel for Communication

In MainActivity.kt:

kotlin
class MainActivity: FlutterActivity() { private val CHANNEL = "zebra.emdk.channel" override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) { super.configureFlutterEngine(flutterEngine) MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL) .setMethodCallHandler { call, result -> if (call.method == "initEMDK") { // Call your initialization method val handler = EMDKHandler() handler.initialize(this) result.success("EMDK Initialized") } else { result.notImplemented() } } } }

5. Call Native Function from Flutter

In your Flutter Dart code:

dart
import 'package:flutter/services.dart'; class EMDKInterface { static const platform = MethodChannel('zebra.emdk.channel'); Future<void> initializeEMDK() async { try { final result = await platform.invokeMethod('initEMDK'); print(result); } catch (e) { print("Failed to initialize EMDK: $e"); } } }

Use this class in your Flutter UI when needed (e.g., when pressing the button).

6. Testing and Debugging

  • Use Zebra hardware or an emulator with an ADB shell to test.

  • Ensure the Zebra device profile is configured using the Zebra StageNow or built-in profile manager.

  • Watch for NullPointerException If EMDK components are not initialized correctly.

Common Pitfalls

  • Missing Permissions: Ensure you include all required permissions in the manifest.

  • Threading Issues: Native code should handle threading for any heavy lifting to avoid UI jank.

  • Unsupported Devices: EMDK only works with Zebra devices; code should handle fallback gracefully on unsupported hardware.

Conclusion

Integrating Zebras EMDK into a Flutter app is absolutely possible using Flutters platform channels. While it requires some understanding of native Android development, the flexibility offered by Flutter, plus the power of Zebras SD,K makes this approach ideal for enterprise applications.

This setup allows you to build modern, cross-platform UIs with Flutter while accessing enterprise hardware features on Zebra devices, bridging the gap between innovation and real-world functionality.