com.craftar
Class CraftARCloudRecognition
- java.lang.Object
-
- com.craftar.ImageRecognition
-
- com.craftar.CraftARCloudRecognition
public class CraftARCloudRecognition extends ImageRecognition
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
cancelPendingSearches()
Cancels all the search requests that have been sent so far and ignores the responses from all requests until search is called again.int
getPendingSearchRequestsCount()
Returns the number of search requests that are pendingSearchController
getSearchController()
Obtain the defaultSearchController
of theCraftARCloudRecognition
instance.static CraftARCloudRecognition
Instance()
Get the singleton instance of the CraftARCloudRecognition.void
onAppFinish()
void
onAppPause()
void
onAppResume()
void
search(CraftARQueryImage image)
Perform an Image Recognition searchvoid
search(CraftARQueryImage image, int requestCode)
Perform an Image Recognition searchvoid
setCollection(java.lang.String collectionToken, SetCloudCollectionListener listener)
Sets the current collection for image recognition search.void
setConnectURL(java.lang.String url)
Sets the url used to perform connect requests.void
setCRSConnect(CRSConnect crsConnect)
Sets the object used to connect to the CraftAR Service.void
setEmbedCustom(boolean value)
Request to embed the custom data in the items, instead of returning it as an URL.void
setRequestBoundingBoxes(boolean value)
Request bounding boxes to the CraftAR service.void
setSearchURL(java.lang.String url)
Sets the url used to perform search requests.-
Methods inherited from class com.craftar.ImageRecognition
getCraftARSearchResponseHandler, setCraftARSearchResponseHandler
-
-
-
-
Method Detail
-
Instance
public static CraftARCloudRecognition Instance()
Get the singleton instance of the CraftARCloudRecognition. Note that you must callCraftARSDK.Instance.init(Context c)
before doing this operation, otherwise it will return null
-
getSearchController
public SearchController getSearchController()
Obtain the defaultSearchController
of theCraftARCloudRecognition
instance. It's not mandatory to use thisSearchController
. If you want to use your ownSearchController
, you can extend the classSearchController
and use the methodCraftARSDK.setSearchController(com.craftar.SearchController)
to tell theCraftARSDK
to use your own implementation.- Returns:
- The default
SearchController
of theCraftARCloudRecognition
instance
-
search
public void search(CraftARQueryImage image)
Perform an Image Recognition search- Specified by:
search
in classImageRecognition
- Parameters:
image
- CraftARQueryImage to use for the recognition search.
-
search
public void search(CraftARQueryImage image, int requestCode)
Perform an Image Recognition search- Specified by:
search
in classImageRecognition
- Parameters:
image
- Image to use for the recognition search.requestCode
- Request identifier passed back on the callbacks
-
setCRSConnect
public void setCRSConnect(CRSConnect crsConnect)
Sets the object used to connect to the CraftAR Service. Use this if you want to create your own CRSConnect to take more control of the network calls.
-
setSearchURL
public void setSearchURL(java.lang.String url)
Sets the url used to perform search requests.
-
setConnectURL
public void setConnectURL(java.lang.String url)
Sets the url used to perform connect requests.
-
getPendingSearchRequestsCount
public int getPendingSearchRequestsCount()
Description copied from class:ImageRecognition
Returns the number of search requests that are pending- Specified by:
getPendingSearchRequestsCount
in classImageRecognition
-
cancelPendingSearches
public void cancelPendingSearches()
Cancels all the search requests that have been sent so far and ignores the responses from all requests until search is called again.
-
setRequestBoundingBoxes
public void setRequestBoundingBoxes(boolean value)
Request bounding boxes to the CraftAR service. By default, bounding boxes are not included.
-
setEmbedCustom
public void setEmbedCustom(boolean value)
Request to embed the custom data in the items, instead of returning it as an URL.
-
setCollection
public void setCollection(java.lang.String collectionToken, SetCloudCollectionListener listener)
Sets the current collection for image recognition search.- Parameters:
collectionToken
- Token of the collection
-
onAppResume
public void onAppResume()
-
onAppPause
public void onAppPause()
-
onAppFinish
public void onAppFinish()
-
-