Overview
The MAUISerialCommSample demonstrates how to leverage Zebra’s EMDK (Enterprise Mobility Development Kit) within a modern .NET MAUI application to exchange data over the device's serial communication channel on Zebra Android mobile computers. This sample application showcases core functionalities of the Serial Communication Manager API, including:
- Serial Channel Management: Enables the serial communication channel via the SerialCommMgr API.
- Data Transmission (Write): Sends byte data over the serial channel.
- Data Reception (Read): Reads byte data from the serial channel using a 10-second timeout.
- Status Feedback: Reports bytes written, data read, and system errors.
- EMDK Initialization & Lifecycle: Creates and releases the EMDKManager in alignment with the Android app lifecycle.
Requirements
To build, deploy, and run this sample, ensure the development environment and target hardware meet the following specifications:
- Framework: .NET MAUI (.NET 10 or later)
- Target OS: Zebra device running Android 11, 13, 14, 15 or later
- EMDK Component: Zebra EMDK for MAUI/Xamarin 11.1 or later
- Development Environment: Visual Studio 2026 or later configured with the .NET Multi-platform App UI development workload.
- Permissions:
com.symbol.emdk.permission.EMDK declared in the Android manifest.
Settings & Actions
| Action / Setting |
Description |
| Write |
Sends the text entered in the Write Data field over the serial channel and displays the number of bytes written. |
| Read |
Retrieves available data from the serial channel using a 10-second timeout. |
| Write Data |
Provides an editable input field to enter text for transmission, which becomes active once the serial channel is ready. |
Loading the Sample Application
- Choose a sample and click See Details.
- Click Download.
IMPORTANT: Extract the downloaded project zip file to C:\ (or to the root of an alternate drive).
- Navigate to the root of the unzipped project folder and double-click the .sln file to load the project in the default IDE.
Alternatively, launch the preferred IDE and load the project via the File > Open menu.
Running the Sample
Visual Studio detects the connected USB device and displays the device name next to the Play button. Press the Play button next to the device name. The IDE builds, deploys and starts the sample app on the device.
Using the Sample App
- Application Launch and EMDK Verification: Launch the MAUISerialCommSample app on the Zebra mobile computer. The application automatically performs EMDK initialization and enables the serial communication channel. Confirm successful initialization and serial communication channel enablement via the status message. (Note: An failure occurs if no serial peripheral is detected.)
- Write Data: Type the text for transmission in the Write Data field and tap Write. The status area displays the number of bytes written.
- Read Data: Tap Read to retrieve data from the serial channel. The read operation times out in 10 seconds. If successful, the Status field displays the retrieved data; if no data is detected within the timeout window, the status indicates that no data is available.