com.craftar
Class CRSConnect
- java.lang.Object
- com.craftar.CRSConnect
public class CRSConnect extends java.lang.Object
CRSConnect allows you to send requests to the CraftAR Recognition Server. If you want to use your own servers and extend the functionality, you can extend this class in your application. If you do so, you must callCraftARCloudRecognition.setCRSConnect(CRSConnect crsConnect)
to make theCraftARCloudRecognition
module to point to your version of the CRSConnect.
-
-
Constructor Summary
Constructors Constructor and Description CRSConnect()
Create a CRSConnect object to perform search and connect requests to the CRS.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
connect(com.craftar.ConnectParams connectParams, com.craftar.CRSConnect.NetworkCallback cb)
Performs a connection against the CraftAR server.void
search(com.craftar.SearchParams searchParams, com.craftar.CRSConnect.NetworkCallback cb)
Searches the image specified in a collection.void
setConnectUrl(java.lang.String url)
Change the default connect url to a custom one.void
setSearchUrl(java.lang.String url)
Change the default search url to a custom one.
-
-
-
Constructor Detail
-
CRSConnect
public CRSConnect()
Create a CRSConnect object to perform search and connect requests to the CRS.
-
-
Method Detail
-
setSearchUrl
public void setSearchUrl(java.lang.String url)
Change the default search url to a custom one. Use this if you want the sdk to interact with your servers instead of interacting directly with the CRS- Parameters:
url
- the url used to perform search();
-
setConnectUrl
public void setConnectUrl(java.lang.String url)
Change the default connect url to a custom one. Use this if you want the sdk to interact with your servers instead of interacting directly with the CRS- Parameters:
url
- the url used to perform connect();
-
connect
public void connect(com.craftar.ConnectParams connectParams, com.craftar.CRSConnect.NetworkCallback cb) throws java.io.IOException
Performs a connection against the CraftAR server. This request is asynchronous and will trigger a callback to aCRSConnectHandler
once it completes. If it succeeds, the server will respond with its timestamp. If the request fails, a the received exception will be forwarded viaCRSConnectHandler#requestFailedResponse(int, Exception)
.- Parameters:
token
- The token to access the collection.- Throws:
java.io.IOException
-
search
public void search(com.craftar.SearchParams searchParams, com.craftar.CRSConnect.NetworkCallback cb) throws java.io.IOException
Searches the image specified in a collection. This request is asynchronous and will trigger a callback to aImageRecognition
.- Parameters:
token
- The token to access the collection.image
- A byte array containing the jpeg image to search.- Throws:
java.io.IOException
ClientProtocolException,
- IOException, ParseException
-
-