PrintConnect on Android Target API level 30

// Expert user has replied.
D David Corsalini 2 years 9 months ago
17 1 0

We are encountering 2 problems related to Android Target API level 30, when using PrintConnect to print labels:

1. Communication via Intent from our app to PrintConnect doesn't work on devices with Android 11 (API level 30), when compiling with Target API level 30. The print doesn't start and we're not receiving a response in out ResultReceiver. Logcat reports this line "ActivityManager: Unable to start service Intent { cmp=com.zebra.printconnect/.print.TemplatePrintService (has extras) } U=0: not found". This is a high priority problem, because it stops printing all together.

2. On Android API level 30, Storage Access Framework (SAF) is mandatory. Due to this, using PrintConnect with "local storage" selected as file storage is now almost impossible. We have to ask the user to choose the folder in which he wants to save the template (generated by the app), but once he chooses one, he's not bound to choose that again the next time we need to update the template or create a new one. A solution to this problem could be that PrintConnect exposes an API that accept a file/string and PrintConnect itself saves it in its private folder.

Target API level 30 is mandatory on the Play Store for new applications starting from august 2021 and for updates to existing applications starting november 2021, so this is a pressing issue.

PrintConnect on Android Target API level 30

// Expert user has replied.
D David Corsalini 2 years 9 months ago
17 0 0

We are encountering 2 problems related to Android Target API level 30, when using PrintConnect to print labels:

1. Communication via Intent from our app to PrintConnect doesn't work on devices with Android 11 (API level 30), when compiling with Target API level 30. The print doesn't start and we're not receiving a response in out ResultReceiver. Logcat reports this line "ActivityManager: Unable to start service Intent { cmp=com.zebra.printconnect/.print.TemplatePrintService (has extras) } U=0: not found". This is a high priority problem, because it stops printing all together.

2. On Android API level 30, Storage Access Framework (SAF) is mandatory. Due to this, using PrintConnect with "local storage" selected as file storage is now almost impossible. We have to ask the user to choose the folder in which he wants to save the template (generated by the app), but once he chooses one, he's not bound to choose that again the next time we need to update the template or create a new one. A solution to this problem could be that PrintConnect exposes an API that accept a file/string and PrintConnect itself saves it in its private folder.

Target API level 30 is mandatory on the Play Store for new applications starting from august 2021 and for updates to existing applications starting november 2021, so this is a pressing issue.

Please register or login to post a reply

1 Replies

S Steven Si

Regarding the issue #1, I don't have any issue with the API level 30 and targetSdkVersion 30. I used the TestConnect example project to test the PrintConnect, which comes with the Link-OS SDK for Android release (in ../link_os_sdk/android/v2.14.5198/TestConnect folder). With targetSdkVersion 30, we only need to add the package info query statement in the AndroidManifest.XML as shown below. This is because Android 11 requires to declare the package ID the app wants to interact with through the intent.

    <queries>
        <package android:name='com.zebra.printconnect' />
    </queries>

I downloaded the PrintConnect app from Google Play. Everything in the TestConnect example project works fine on an Android 11 device. It prints both the shelf label and receipt successfully. The build.gradle of my TestConnect project is shown below.

android {
    compileSdkVersion 30
    buildToolsVersion '30.0.2'


    defaultConfig {
        applicationId "com.zebra.testconnect"
        minSdkVersion 15
        targetSdkVersion 30
        versionCode 2
        versionName getFullVersionName()

        println "Building version: " + versionName;
    }

Would you clarify how you encounter the issue or share the code that reproduces the issue?

CONTACT
Can’t find what you’re looking for?