Pikkart-AR SDK  3.5
Android SDK References
com.pikkart.ar.geo.GeoActivity Class Reference

A basic Activity including Pikkart Augmented Reality SDK features. More...

Inherits AppCompatActivity, com.pikkart.ar.recognition.IRecognitionListener, and com.pikkart.ar.geo.IArGeoListener.

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...
 
void onGeoElementClicked (GeoElement geoElement)
 Called whenever a marker is clicked. More...
 
void onMapOrCameraClicked ()
 Called each time a tap doesn't hit any marker. More...
 
void onGeolocationChanged (Location geoLocation)
 Called each time the device sensors give an update about the user position. More...
 
void onGeoBringInterfaceOnTop ()
 Called each time the view needs to be redrawn. 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...
 

Detailed Description

The GeoActivity is a an Android Activity that includes a GeoFragment in order to control the camera and map 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 GeoFragment to manage the geo process

Extending this activity makes possible to override its methods from IRecognitionListener and IArGeoListener.

Member Function Documentation

◆ startRecognition()

void com.pikkart.ar.geo.GeoActivity.startRecognition ( RecognitionOptions  recognitionOptions)

Starts the recognition process with the selected RecognitionOptions and IRecognitionListener

◆ stopRecognition()

void com.pikkart.ar.geo.GeoActivity.stopRecognition ( )

Stop the active recognition process manually without closing the camera.

◆ changeRecognitionOptions()

void com.pikkart.ar.geo.GeoActivity.changeRecognitionOptions ( RecognitionOptions  recognitionOptions)

Changes the current RecognitionOptions without stopping the recognition process.

◆ setMarkerCacheSize()

void com.pikkart.ar.geo.GeoActivity.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.

◆ isRecognitionActive()

boolean com.pikkart.ar.geo.GeoActivity.isRecognitionActive ( )

Returns if the recognition is currently active.

◆ isTracking()

static boolean com.pikkart.ar.geo.GeoActivity.isTracking ( )
static

Returns if the Pikkart-AR SDK is currently tracking a marker.

◆ getCurrentMarker()

static Marker com.pikkart.ar.geo.GeoActivity.getCurrentMarker ( )
static

Returns the currently tracked marker.

Returns
A Marker object if the Pikkart-AR SDK is currently tracking a marker, null otherwise.

◆ getCurrentProjectionMatrix()

static float [] com.pikkart.ar.geo.GeoActivity.getCurrentProjectionMatrix ( )
static

Returns the current projection matrix and make it available for rendering purpose.

Returns
A row-major array of 16 float representing a 4x4 matrix.

◆ getCurrentModelViewMatrix()

static float [] com.pikkart.ar.geo.GeoActivity.getCurrentModelViewMatrix ( )
static

Returns the current modelview matrix and make it available for rendering purpose.

Returns
A row-major array of 16 float representing a 4x4 matrix.

◆ renderCamera()

static void com.pikkart.ar.geo.GeoActivity.renderCamera ( int  viewportWidth,
int  viewportHeight,
int  angle 
)
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.

Parameters
viewportWidthThe width in pixels of the rendered camera image.
viewportHeightThe height in pixels of the rendered camera image.
angleThe current angle of rotation of the device.

◆ enableTorch()

boolean com.pikkart.ar.geo.GeoActivity.enableTorch ( )

Turn on the torch of the device.

Returns
true if the device provides a torch, false otherwise

◆ disableTorch()

boolean com.pikkart.ar.geo.GeoActivity.disableTorch ( )

Turn off the torch of the device.

Returns
true if the device provides a torch, false otherwise

◆ setFocusMode()

void com.pikkart.ar.geo.GeoActivity.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.

Parameters
modeA string representing a focus mode included in Camera.Parameters.

◆ getFocusMode()

String com.pikkart.ar.geo.GeoActivity.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.

Returns
A String representing the currently set focus mode .

◆ executingCloudSearch()

void com.pikkart.ar.geo.GeoActivity.executingCloudSearch ( )

Called whenever the current image is sent to the Pikkart Cloud Recognition Service.

Implements com.pikkart.ar.recognition.IRecognitionListener.

◆ cloudMarkerNotFound()

void com.pikkart.ar.geo.GeoActivity.cloudMarkerNotFound ( )

Called whenever the Pikkart Cloud Recognition Service returns a negative response.

Implements com.pikkart.ar.recognition.IRecognitionListener.

◆ markerFound()

void com.pikkart.ar.geo.GeoActivity.markerFound ( Marker  marker)

Called whenever a marker is found.

Parameters
markerA Marker object encapsulating all the information about the marker just found.

Implements com.pikkart.ar.recognition.IRecognitionListener.

◆ markerNotFound()

void com.pikkart.ar.geo.GeoActivity.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.

◆ markerTrackingLost()

void com.pikkart.ar.geo.GeoActivity.markerTrackingLost ( String  markerId)

Called whenever the tracking of the marker is lost.

Parameters
markerIdThe id of the marker just lost.

Implements com.pikkart.ar.recognition.IRecognitionListener.

◆ internetConnectionNeeded()

void com.pikkart.ar.geo.GeoActivity.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.

◆ isConnectionAvailable()

boolean com.pikkart.ar.geo.GeoActivity.isConnectionAvailable ( Context  context)

A method used to check for internet connection before sending request to the Pikkart Cloud Recogntion Server.

Returns
true if an internet connection is available, false otherwise

Implements com.pikkart.ar.recognition.INetworkInfoProvider.

◆ ARLogoFound()

void com.pikkart.ar.geo.GeoActivity.ARLogoFound ( String  markerId,
int  code 
)

Called whenever an ARLogo has been found.

Parameters
markerIdThe id of the marker.
codeThe ARLogo code found.

Implements com.pikkart.ar.recognition.IRecognitionListener.

◆ markerEngineToUpdate()

void com.pikkart.ar.geo.GeoActivity.markerEngineToUpdate ( String  markerid)

Called whenever the app has an old SDK and can't open new markers.

Parameters
markeridThe id of the marker that cannot be loaded.

Implements com.pikkart.ar.recognition.IRecognitionListener.

◆ onGeoElementClicked()

void com.pikkart.ar.geo.GeoActivity.onGeoElementClicked ( GeoElement  geoElement)

Called whenever a marker is clicked.

Parameters
geoElementA GeoElement object encapsulating all the information about the marker just clicked

Implements com.pikkart.ar.geo.IArGeoListener.

◆ onMapOrCameraClicked()

void com.pikkart.ar.geo.GeoActivity.onMapOrCameraClicked ( )

Called each time a tap doesn't hit any marker.

Implements com.pikkart.ar.geo.IArGeoListener.

◆ onGeolocationChanged()

void com.pikkart.ar.geo.GeoActivity.onGeolocationChanged ( Location  geoLocation)

Called each time the device sensors give an update about the user position.

Implements com.pikkart.ar.geo.IArGeoListener.

◆ onGeoBringInterfaceOnTop()

void com.pikkart.ar.geo.GeoActivity.onGeoBringInterfaceOnTop ( )

Called each time the view needs to be redrawn. You have to put back on top your views here

Implements com.pikkart.ar.geo.IArGeoListener.