Skip to content

An Android application built using the Google Code Scanner API to scan QR codes and barcodes. It can function as both an event and action plugin for Tasker.

Notifications You must be signed in to change notification settings

abhishekabhi789/GCS_for_Tasker

Repository files navigation


GCS for Tasker

API 21+ GitHub all releases GitHub release (latest by date including pre-releases) demo project download
GCS for Tasker is an Android application that can act as both a Tasker event plugin and action plugin. This app uses the Google Code Scanner API to scan and extract information from QR codes.

⚙️ Requirements

This is a Tasker Plugin, and it requires the Tasker Android app to function. To use this app, you must have an Android device with an API level of 21 or higher, as the Code Scanner API works on devices with this API level or above. Furthermore, it is necessary to have the Google Play Services installed on the device.

💡 Features

With the GCS for Tasker app, you can easily integrate QR code scanning into your Tasker projects. This app supports both scanning events and actions. This app doesn't ask for camera permissions, nor does it store or share any data except with Tasker.

🧬 Variants

There are two variants available for this project based on the theme used in event configuration activity. Classic themed app is smaller in size and material themed app is around 4 times bigger. Both are having same package name and are signed with same key, you can switch them anytime. It's recommended to clear the app data after such switching to release storage space consumed by previous variant.

🛠️ How to Setup

Install this plugin app and Tasker.

In Tasker

  • For events, select the "Event" option, then choose "Plugin" and select "GCS for Tasker" from the list. From there, you can configure the event based on your preferences.

    • Value filter: The event will trigger only when the raw value of the scanned code matches the value filter. This field supports both simple and regex matching. Adjust the switch next to this field to choose simple matching or regex matching.
    • Type filter: The event will trigger only when the qr code type matches any of the type filter. Refer Barcode.BarcodeValueType for more about code types.
    • Format filter: The event will trigger only when the code format matches any of the format filter. Refer Barcode.BarcodeFormat for more about code formats.

    The event will trigger only if all specified filters are satisfied.

  • For actions, select "Plugin" from the "Select action category" list, and then choose "GCS for Tasker". Then on the configuration activity you can configure below settings.

    • Format filter: The code scanner will only detect codes having the chosen format.
    • Enable auto zoom: The scanner will try to automatically zoom the camera towards the code.
    • Allow manual input: The scanner allows manual input of code value.

All the code types and code formats can be copied from event and action configuration.

In GCS for Tasker

After completing the Tasker setup, try to perform a scan.

  • If scanner modules are present, you will see the camera opened with the Google Code Scanner UI.
  • If scanner modules are absent, you will see a toast message saying "Waiting for the Barcode UI module to be downloaded."
    • This download is a background task and is handled by the Google Play Service. You won't be notified when the task is completed.

Here's an example project. Import it from TaskerNet

❓ FAQ

Can this be used on a device that does not have Google Play Services?

No, the app uses the unbundled Google code scanner API provided by Google Play Services on the device.

Does the app require an internet connection to function?

This app does not require an internet connection since the scanner library is capable of working offline. However, Google Play Services requires an internet connection to download QR scanner libraries if they are not already present on your device.

Does clearing app data delete any setup or data?

For API 25+(Android 7.1+) devices, the shortcut configuration will be cleared when cleaning app data. No scanner related functionalities affected with clearing app data. All configuration data is stored in Tasker and the scanner library is in google play services. Also, if you want to save the scan results, you have to set up a Tasker task to do so.

🔧 Troubleshoot

Scanner module not downloading.

  • Ensure internet connection.
  • Ensure battery saver is turned off.
  • Update play service if available.
  • Reboot device.

If problem persists try

  • clearing the data of Google Play Services (Attention!: Use caution when deleting)
  • Upgrade or downgrade Google Play Services.

Code Scanned but no response from Tasker.

  • Try a different code to make sure the tasker setup is correct.
  • Check Tasker run log.
  • Try both event and action.
  • Create a new event/action without any filter rules and flash the output.

Scanner UI doesn't dismiss after action timeout.

The library does not provide a method to programmatically close or set a timeout for the scanner. You can consider using Tasker/AutoInput to click the close button or the back button after the action fails due to timeout.

Error: Failed to scan code.

If the scanner throws 'Failed to scan code' error, try clearing the app data of Google Play Service. It's a Google Code Scanner module related issue

About

An Android application built using the Google Code Scanner API to scan QR codes and barcodes. It can function as both an event and action plugin for Tasker.

Topics

Resources

Stars

Watchers

Forks

Languages