Class BlukiiInfo
BlukiiClient class contains discovery functions as follows:
- Request for getting blukii Info output data.
- Reporting of blukii Info clicks.
- Reporting of blukii Info violations.
Note: These functions needs to set an developers API key by
(@see BlukiiCloud.setApiKey(String)
). Settings of credentials and
user login is not needed for BlukiiInfo functions.
Additionally, 'android.permission.INTERNET' has to be declared as 'user-permission' in your apps manifest.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Listener for callbacks of functiongetInfoBundles(List, OnGetInfoBundlesListener)
.static interface
Listener for callbacks of functiongetInfoData(List, OnGetInfoDataListener)
.static interface
Listener for callbacks of functionreportClick(String, long, OnReportListener)
andreportInfoViolation(InfoData, String, String, String, String, OnReportListener)
. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
convertBarCodeToBlukiiId
(String barCode) Converts a numbered barcode string into the blukii ID format.static String
convertNfcToBlukiiId
(String nfcCode) Converts a NFC Code into the blukii ID format.extractBlukiiIds
(List<DiscoveryData> discoveryDataList) Static helper for extracting all blukii IDs out of a list ofDiscoveryData
objects, as it is retrieved by BlukiiiClient discovery (seeBlukiiClient.OnDiscoveryListener.onDiscoveryResult(List)
).void
getInfoBundles
(List<String> infoBundleIds, BlukiiInfo.OnGetInfoBundlesListener listener) Request to blukii Manager Info CMS for retrieving info bundles data of a list ob bundle IDs.void
getInfoData
(List<String> blukiiIds, BlukiiInfo.OnGetInfoDataListener listener) Request to blukii Manager Info CMS for retrieving output data of a list of blukii IDs.int
Gets the timeout for the resolver cache.void
reportClick
(String blukiiId, long timeStamp, BlukiiInfo.OnReportListener listener) Reports to blukii Manager Info CMS that a blukii Info has been clicked by user.void
reportInfoViolation
(InfoData infoData, String language, String senderName, String senderEmail, String messageText, BlukiiInfo.OnReportListener listener) Reports a blukii Info to blukii Manager Info CMS support if the blukii Info data violates copyright laws or contains any not allowed content.void
setInfoDatacacheTimeout
(int infoDatacacheTimeout) Gets the timeout for the resolver cache.
-
Field Details
-
OUTPUTLANGUAGE_ENGLISH
Output language id for English -
OUTPUTLANGUAGE_FRENCH
Output language id for French -
OUTPUTLANGUAGE_GERMAN
Output language id for German -
INFODATA_CACHETIMEOUT_DEFAULT
public static final int INFODATA_CACHETIMEOUT_DEFAULTDefault cache timeout: 180000 milliseconds (30 minutes).Relevant for
getInfoData(List, OnGetInfoDataListener)
-
-
Method Details
-
getInfoDatacacheTimeout
public int getInfoDatacacheTimeout()Gets the timeout for the resolver cache.Relevant for
getInfoData(List, OnGetInfoDataListener)
You can use this feature to minimize network traffic by caching retrieved values. If
InfoData
is found for one blukii id the next network request will be done again only after cache timeout.If value is 0, cache is off.
- Returns:
- timeout for resolver cache in milliseconds as integer
- See Also:
-
setInfoDatacacheTimeout
public void setInfoDatacacheTimeout(int infoDatacacheTimeout) Gets the timeout for the resolver cache.You can use this feature to minimize network traffic by caching retrieved values. If
InfoData
is found for one blukii id the next network request will be done again only after cache timeout.If value is 0, cache is off.
- Parameters:
infoDatacacheTimeout
- cache timeout in milliseconds, default isINFODATA_CACHETIMEOUT_DEFAULT
- See Also:
-
getInfoData
@RequiresPermission("android.permission.INTERNET") public void getInfoData(@NonNull List<String> blukiiIds, @NonNull BlukiiInfo.OnGetInfoDataListener listener) Request to blukii Manager Info CMS for retrieving output data of a list of blukii IDs.The blukiiIds must follow the blukii Id format like 'blukii BXXXXX 1234567890AB'
If request is successful, callback
BlukiiInfo.OnGetInfoDataListener.onGetInfoData(List, boolean)
is called, otherwise an error response is called to callbackBlukiiInfo.OnGetInfoDataListener.onError(BlukiiCloudError)
.Please find the following static helper functions for extracting or converting blukii IDs.
- Parameters:
blukiiIds
- list of blukii IDslistener
- listener forBlukiiInfo.OnGetInfoDataListener
callbacks.- See Also:
-
getInfoBundles
@RequiresPermission("android.permission.INTERNET") public void getInfoBundles(@NonNull List<String> infoBundleIds, @NonNull BlukiiInfo.OnGetInfoBundlesListener listener) Request to blukii Manager Info CMS for retrieving info bundles data of a list ob bundle IDs.Bundle IDs are encoded and can be read from and InfoData object via
InfoData.getBundleList()
, if the corresponding info is part of at least one info bundle.If request is successful, callback
BlukiiInfo.OnGetInfoBundlesListener.onGetInfoBundles(List, boolean)
is called, otherwise an error response is called to callbackBlukiiInfo.OnGetInfoBundlesListener.onError(BlukiiCloudError)
.- Parameters:
infoBundleIds
- list of bundle IDslistener
- listener forBlukiiInfo.OnGetInfoBundlesListener
callbacks.- See Also:
-
reportInfoViolation
@RequiresPermission("android.permission.INTERNET") public void reportInfoViolation(@NonNull InfoData infoData, @NonNull String language, @NonNull String senderName, @NonNull String senderEmail, @NonNull String messageText, @NonNull BlukiiInfo.OnReportListener listener) Reports a blukii Info to blukii Manager Info CMS support if the blukii Info data violates copyright laws or contains any not allowed content.- Parameters:
infoData
-InfoData
object, retrieved bygetInfoData(List, OnGetInfoDataListener)
language
- language id of the violated output (seeInfoData.getOutputDataList()
)senderName
- Name of person who sends the reportsenderEmail
- Email of person who sends the reportmessageText
- Message text that describes the violationlistener
- listener forBlukiiInfo.OnReportListener
callbacks- See Also:
-
reportClick
@RequiresPermission("android.permission.INTERNET") public void reportClick(@NonNull String blukiiId, long timeStamp, @NonNull BlukiiInfo.OnReportListener listener) Reports to blukii Manager Info CMS that a blukii Info has been clicked by user.- Parameters:
blukiiId
- blukii id of the Info that has been clickedtimeStamp
- time of clicklistener
- listener forBlukiiInfo.OnReportListener
callbacks
-
extractBlukiiIds
Static helper for extracting all blukii IDs out of a list ofDiscoveryData
objects, as it is retrieved by BlukiiiClient discovery (seeBlukiiClient.OnDiscoveryListener.onDiscoveryResult(List)
).- Parameters:
discoveryDataList
- list ofDiscoveryData
objects- Returns:
- list of blukii IDs
-
convertBarCodeToBlukiiId
Converts a numbered barcode string into the blukii ID format.The following formats can be converted:
- EAN-8
- EAN-13
- UPC-A
- PZN-7 (must start with '-')
- PZN-8 (must start with '-')
- Parameters:
barCode
- numbered barcode string- Returns:
- blukii ID, null if not supported barcode format
-
convertNfcToBlukiiId
Converts a NFC Code into the blukii ID format.The NFC code must contain the NFC tag's mac address as hex string.
- Parameters:
nfcCode
- NFC hex string- Returns:
- blukii ID, null if NFC hex string is not valid
-