question

ramya avatar image
ramya asked ramya edited

Is there any update on getting labels connected to the printer and item through clover android sdk?

We had been working on label printing.

Getting printer connected labels and item attached labels using Clover API. But sometimes unable to get exact connected printers for that labels.


I have checked on Clover Android SDK but there is no label tag available.

And asked this https://community.clover.com/questions/13057/how-to-get-list-of-lables-connected-to-the-printer.html before. Is there any possibility to read Labels for Item and printer using only Android SDK with out using API?



App Marketclover developer communityPrint
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Jacob Abrams avatar image
Jacob Abrams answered ramya edited

Note that in the user interface for merchants we use the term "labels" but in the clover-android-sdk we use the term "tags" instead.

It's not clear to me what you mean by "only Android SDK with out using API?" Do you mean clover-android-sdk vs Clover REST API? The clover-android-sdk should have everything you need.

To get tags assigned to particular printer you would first use PrinterConnector#getPrinters to get all the configured printers. Then you can use InventoryConnector#getTagsForPrinter to get tags for a particular printer. You can use InventoryConnector#getTagsForItem to get tags for a particular item.

Here is an example of using the contract to determine which items are associated with a particular tag:

# Using the contract to get all the items for a particular tag
Cursor cursor = getContentResolver().query(
    InventoryContract.ItemTag.contentUriWithAccount(account), 
    null, 
    InventoryContract.ItemTag.TAG_UUID + "=?", 
    new String[] { tag.getId() }, 
    null);
Log.d(TAG, "Tag " + tag.getId() + " has " + cursor.getCount() + " assigned items");
cursor.close
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ramya avatar image ramya commented ·

Thank you jacob, am able to get tags through clover-android-sdk now.

0 Likes 0 ·

Welcome to the
Clover Developer Community