A basic Activity including Pikkart Augmented Reality SDK features. More...
Inherits AppCompatActivity, and com.pikkart.ar.recognition.IRecognitionListener.
Public Member Functions | |
void | startRecognition (RecognitionOptions recognitionOptions) |
Starts the recognition process with the selected RecognitionOptions and IRecognitionListener. More... | |
void | stopRecognition () |
Stop the active recognition process manually without closing the camera. More... | |
void | changeRecognitionOptions (RecognitionOptions recognitionOptions) |
Changes the current RecognitionOptions without stopping the recognition process. More... | |
void | setMarkerCacheSize (int markerCacheSize) |
Set the max number of markers to keep locally. More... | |
boolean | isRecognitionActive () |
Returns if the recognition is currently active. More... | |
boolean | enableTorch () |
Turn on the torch of the device. More... | |
boolean | disableTorch () |
Turn off the torch of the device. More... | |
void | setFocusMode (String mode) |
Set the selected focus mode for the camera if available for the device. More... | |
String | getFocusMode () |
Retrieve the currently set focus mode. More... | |
void | executingCloudSearch () |
Called whenever the current image is sent to the Pikkart Cloud Recognition Service. More... | |
void | cloudMarkerNotFound () |
Called whenever the Pikkart Cloud Recognition Service returns a negative response. More... | |
void | markerFound (Marker marker) |
Called whenever a marker is found. More... | |
void | markerNotFound () |
Called whenever the Pikkart-AR SDK doesn't find any marker before the timeout exceed. More... | |
void | markerTrackingLost (String markerId) |
Called whenever the tracking of the marker is lost. More... | |
void | internetConnectionNeeded () |
Called whenever an internet connection is needed for communicating with the Pikkart Cloud Recognition Service but not available. More... | |
boolean | isConnectionAvailable (Context context) |
A method used to check for internet connection before sending request to the Pikkart Cloud Recogntion Server. More... | |
void | ARLogoFound (String markerId, int code) |
Called whenever an ARLogo has been found. More... | |
void | markerEngineToUpdate (String markerid) |
Called whenever the app has an old SDK and can't open new markers. More... | |
Static Public Member Functions | |
static boolean | isTracking () |
Returns if the Pikkart-AR SDK is currently tracking a marker. More... | |
static Marker | getCurrentMarker () |
Returns the currently tracked marker. More... | |
static float [] | getCurrentProjectionMatrix () |
Returns the current projection matrix and make it available for rendering purpose. More... | |
static float [] | getCurrentModelViewMatrix () |
Returns the current modelview matrix and make it available for rendering purpose. More... | |
static void | renderCamera (int viewportWidth, int viewportHeight, int angle) |
Create a texture and render the current camera frame. More... | |
The RecognitionActivity is a an Android Activity that includes a RecognitionFragment in order to control the camera and the recognition process.
At its creation it open the camera and setup all its parameters and the internal variables of the system.
It exposes the same methods of the RecognitionFragment to manage the recognition process and the communication with the Pikkart Cloud Recognition Service
Extending this activity makes possible to override its methods from IRecognitionListener.
void com.pikkart.ar.recognition.RecognitionActivity.startRecognition | ( | RecognitionOptions | recognitionOptions | ) |
Starts the recognition process with the selected RecognitionOptions and IRecognitionListener
void com.pikkart.ar.recognition.RecognitionActivity.stopRecognition | ( | ) |
Stop the active recognition process manually without closing the camera.
void com.pikkart.ar.recognition.RecognitionActivity.changeRecognitionOptions | ( | RecognitionOptions | recognitionOptions | ) |
Changes the current RecognitionOptions without stopping the recognition process.
void com.pikkart.ar.recognition.RecognitionActivity.setMarkerCacheSize | ( | int | markerCacheSize | ) |
Set the max number of markers to keep locally.
If this limit is overcome the oldest accessed markers will be deleted in order to avoid a performance degradation.
Markers from local database will not be deleted even if overcome this limit.
boolean com.pikkart.ar.recognition.RecognitionActivity.isRecognitionActive | ( | ) |
Returns if the recognition is currently active.
|
static |
Returns if the Pikkart-AR SDK is currently tracking a marker.
|
static |
Returns the currently tracked marker.
|
static |
Returns the current projection matrix and make it available for rendering purpose.
|
static |
Returns the current modelview matrix and make it available for rendering purpose.
|
static |
Create a texture and render the current camera frame.
This method has to be called inside an OpenGL context and called whenever is necessary to update the current image.
It manages automatically creation, update and deletion of the texture.
Please refers to the tutorial if you want a better understanding of how to use this method.
viewportWidth | The width in pixels of the rendered camera image. |
viewportHeight | The height in pixels of the rendered camera image. |
angle | The current angle of rotation of the device. |
boolean com.pikkart.ar.recognition.RecognitionActivity.enableTorch | ( | ) |
Turn on the torch of the device.
boolean com.pikkart.ar.recognition.RecognitionActivity.disableTorch | ( | ) |
Turn off the torch of the device.
void com.pikkart.ar.recognition.RecognitionActivity.setFocusMode | ( | String | mode | ) |
Set the selected focus mode for the camera if available for the device.
Currently supported focus modes are FOCUS_MODE_MACRO, FOCUS_MODE_INFINITY, FOCUS_MODE_CONTINUOUS_VIDEO, FOCUS_MODE_AUTO included into Camera.Parameters class of the Android SDK.
mode | A string representing a focus mode included in Camera.Parameters. |
String com.pikkart.ar.recognition.RecognitionActivity.getFocusMode | ( | ) |
Retrieve the currently set focus mode.
Currently supported focus modes are FOCUS_MODE_MACRO, FOCUS_MODE_INFINITY, FOCUS_MODE_CONTINUOUS_VIDEO, FOCUS_MODE_AUTO included into Camera.Parameters class of the Android SDK.
void com.pikkart.ar.recognition.RecognitionActivity.executingCloudSearch | ( | ) |
Called whenever the current image is sent to the Pikkart Cloud Recognition Service.
Implements com.pikkart.ar.recognition.IRecognitionListener.
void com.pikkart.ar.recognition.RecognitionActivity.cloudMarkerNotFound | ( | ) |
Called whenever the Pikkart Cloud Recognition Service returns a negative response.
Implements com.pikkart.ar.recognition.IRecognitionListener.
void com.pikkart.ar.recognition.RecognitionActivity.markerFound | ( | Marker | marker | ) |
Called whenever a marker is found.
marker | A Marker object encapsulating all the information about the marker just found. |
Implements com.pikkart.ar.recognition.IRecognitionListener.
void com.pikkart.ar.recognition.RecognitionActivity.markerNotFound | ( | ) |
Called whenever the Pikkart-AR SDK doesn't find any marker before the timeout exceed.
This callback is called only with RecognitionStorage set to GLOBAL and RecognitionMode set to TAP_TO_SCAN.
Implements com.pikkart.ar.recognition.IRecognitionListener.
void com.pikkart.ar.recognition.RecognitionActivity.markerTrackingLost | ( | String | markerId | ) |
Called whenever the tracking of the marker is lost.
markerId | The id of the marker just lost. |
Implements com.pikkart.ar.recognition.IRecognitionListener.
void com.pikkart.ar.recognition.RecognitionActivity.internetConnectionNeeded | ( | ) |
Called whenever an internet connection is needed for communicating with the Pikkart Cloud Recognition Service but not available.
Implements com.pikkart.ar.recognition.IRecognitionListener.
boolean com.pikkart.ar.recognition.RecognitionActivity.isConnectionAvailable | ( | Context | context | ) |
A method used to check for internet connection before sending request to the Pikkart Cloud Recogntion Server.
Implements com.pikkart.ar.recognition.INetworkInfoProvider.
void com.pikkart.ar.recognition.RecognitionActivity.ARLogoFound | ( | String | markerId, |
int | code | ||
) |
Called whenever an ARLogo has been found.
markerId | The id of the marker. |
code | The ARLogo code found. |
Implements com.pikkart.ar.recognition.IRecognitionListener.
void com.pikkart.ar.recognition.RecognitionActivity.markerEngineToUpdate | ( | String | markerid | ) |
Called whenever the app has an old SDK and can't open new markers.
markerid | The id of the marker that cannot be loaded. |
Implements com.pikkart.ar.recognition.IRecognitionListener.