public final class

VDARSDKController

extends Object
implements Application.ActivityLifecycleCallbacks VDARImageReceiver
java.lang.Object
   ↳ com.vidinoti.android.vdarsdk.VDARSDKController

Class Overview

The context manager orchestrating all the Vidinoti AR system. It accecpts frame to process them and manage the local AR DB

Summary

Constants
int ImageStreamTypeSize
String SDK_START_INTENT
Fields
public static int CAMERA_REQUEST_ID ID of the camera permission request that is used by PixLive SDK
public static int EXTERNAL_STORAGE_REQUEST_ID ID of the external storage permission request that is used by PixLive SDK
public static int LOCALIZATION_GPSNOTIFICATIONS_REQUEST_ID ID of the localization permission request that is used by PixLive SDK for GPS Notifications
public static int LOCALIZATION_REQUEST_ID ID of the localization permission request that is used by PixLive SDK
Public Methods
void addNewAfterLoadingTask(Runnable t)
Run the provided task after the vision is system is loaded.
void askForNearbyRequirements()
Check if the bluetooth is set and localisation is enabled.
void autofocus()
Request the connected camera to trigger the autofocus mechanism.
boolean bindService(Intent intent, ServiceConnection connection, int mode)
void disableContext(String contextID)
Disables the context.
void disableContexts()
Disables all the contexts.
void enableContext(String contextID)
Enables the context that has been disabled (see disableContext(String)).
void enableContextsWithTags(List<String> tags)
Enables all contexts belonging to specific tags.
void forceLanguage(String languageCode)
Sets the language of the SDK interface.
String generateDeviceReport(VDARImageSender camera, String errorDetails)
Generate a device report.
String getAPIKey()
The current API key used by the SDK
VDARAjaxAppDataProvider getAjaxAppDataProvider()
Get the provider that will give special data to the annotation subsystem when an Ajax request is generated with the APP HTTP method type.
ArrayList<String> getAllContextIDs()
Return all the local contexts IDs contained in the local AR DB.
static Context getAndroidActivity()
Return the current Android activity used to perform OS tasks like opening a browser or making the device vibrating.
Context getApplicationContext()
String getCloudRecognitionLanguage()
Returns the language that should be used for the cloud recognition.
VDARContext getContext(String remoteID)
Return the context associated with the local AR DB ID passed in parameter
Class<? extends Activity> getCustomWebviewActivityClass()
Return the activity which will be launched when a web view has to be presented.
String getDeviceUUID()
Return the Unique identifier of the device
final static VDARSDKController getInstance()
Return the singleton instance of the SDK Controller.
VDARLocalizationManager getLocalizationManager()
Return the localization manager to provide location capabilities
long getNbModelsInDB()
Return the number of contexts that the system has in memory and is capable of recognizing.
List<String> getNearbyBeacons()
Returns the list of context ID of nearby beacons
VDARNearbyGPSManager getNearbyGPSManager()
Return the nearby gps manager to provide list of new gps points nearby
HashMap<StringString> getNearbyStatus()
Returns the list of context ID of nearby beacons
NotificationFactory getNotificationFactory()
ArrayList<ContextNotification> getPendingNotifications()
Return the currently available notifications, that are not acknowledged neither ignored, that have been posted while the application was / is alive.
synchronized EnumSet<VDARCodeType> getRecognizableCode()
Return the different type of codes the system will recognize if code detection is enabled.
static String getSDKVersion()
Return the SDK current version number
boolean isBookmarkSupportEnabled()
synchronized boolean isCodesRecognitionEnabled()
Returns wether or not the system performs QR code and similar codes recognition.
static boolean isContainingBeacons()
Return YES if the app contain GPS points, NO otherwise
static boolean isDeviceSupported()
Return true if the device is supported and can run VDARSDK, false otherwise.
boolean isLoaded()
Return true if the local AR DB is loaded, false if it is currently being loaded.
boolean isNotificationSupportEnabled()
Return true or false depending if the notification support is enabled.
boolean isPauseVisionRecognition()
True if the vision recognition is currently paused (image and code recognition), false otherwise.
boolean isTablet()
static void log(int priority, String tag, String msg)
Write a log message to the console.
void onActivityCreated(Activity activity, Bundle savedInstanceState)
void onActivityDestroyed(Activity activity)
void onActivityPaused(Activity activity)
void onActivityResumed(Activity activity)
void onActivitySaveInstanceState(Activity activity, Bundle outState)
void onActivityStarted(Activity activity)
void onActivityStopped(Activity activity)
void onBeaconServiceConnect()
void onNewIntent(Intent intent)
Notify the SDK of a new intent.
void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
This method should be called by your activity whenever this method is called on your activity
void openURLInInternalBrowser(URL url)
Open the given URL in the internal browser embedded in the VDARSDK
void playAR(String url)
Open the ARCore scanner with integrated webview.
void presentNearbyList()
Presents a list with the "nearby" beacons.
void presentNearbyList(float latitude, float longitude)
Presents a list with the "nearby" elements.
void presentNotificationsList()
Display the default notification list
void previewContext(String contextID, Observer callback)
The preview of the passed context is shown.
void processNewImageFrame(VDARFrame openGLFrame, double currentTime)
When calling this method, the implemented class will use that new image frame to update its own recognition pipeline with the image content.
void processNotification(String notification, boolean remote)
Process and execute the action residing in the notification received by the device.
void refreshNearbyList(float latitude, float longitude)
Updates the list with "nearby" elements if it is visible.
void registerContentEventReceiver(VDARContentEventReceiver receiver)
Register a new object to receive event from the content Multiple receivers are supported.
void registerEventReceiver(VDARSDKControllerEventReceiver receiver)
Register a new object to receive event from the augmented reality system.
void registerSensorEventReceiver(VDARSDKSensorEventReceiver receiver)
Register a new object to receive event from the sensor system.
void releaseCamera()
Releases the camera.
void releaseMemory()
Force the VDARSDK subsystems to release as much memory as they can.
void runInRenderingThread(Runnable r)
This method is used internally and should not be called.
static void runOnUiThread(Runnable r)
Run the specific Runnable on the UI Thread
boolean save()
Save the current local AR DB
void setARViewOpenEventListener(ARViewOpenEventListener listener)
When a content needing the AR view to be opened is triggered, usually due to a beacon event, the app needs to open the AR view.
void setActivity(Activity activity)
Set the current activity using the VDARSDK.
void setAjaxAppDataProvider(VDARAjaxAppDataProvider ajaxAppDataProvider)
Set the provider that will give special data to the annotation subsystem when an Ajax request is generated with the APP HTTP method type.
void setAppForeground(boolean isAppForeground)
If the SDK is started after the app is created, it cannot know if the app is started or not.
void setBookmarkSupport(boolean enabled)
Enables the support of bookmarks.
void setCloudRecognitionLanguage(String cloudRecognitionLanguage)
Forces the language to be used for the cloud recognition
void setCustomPdfViewer(PDFRequestHandler pdfRequestHandler)
Defines a custom PDF viewer.
void setCustomWebviewActivityClass(Class<? extends Activity> c)
Set the activity which should be started when the internal web browser has to be opened for a web page.
void setDeviceOrientation(VDARDeviceOrientation d)
Set the current device orientation.
void setDisplayModelDebugOverlay(boolean showOverlay)
Set wether or not to display an overlow displaying where the context has been detected.
void setEnableCodesRecognition(boolean enableCodesRecognition)
Whether or not to enable codes (such as QR codes) recognition.
void setEnableDefaultNotificationController(boolean val)
When a notification arrives in a state where the application is open, the SDK will handle it and display a list of context the user can choose.
void setEnableNearbyRequirementDialog(boolean enable)
Enables/disables the nearby requirement dialog asking for bluetooth/localisation requirement If enabled, a dialog will ask the user to enabled the required settings for bluetooth and localisation when the SDK start to scan for beacons.
void setEnablePendingNotifications(boolean enable)
Enables/disables the pending notification list when a beacon notification is received.
void setImageSender(VDARImageSender camera)
Set the current image sender (i.e.
void setLicenseKey(String licenseKey)
Allows changing the license key when the SDK is already running.
void setNotificationFactory(NotificationFactory creator)
Set the notification creator used to create a notification when, for example, a beacon is detected.
void setNotificationsSupport(boolean enabled)
Enable / Disable app push notification support
void setNotificationsSupport(boolean enabled, String senderID)
This method is deprecated. the senderID is not needed anymore, use setNotificationsSupport(boolean)
void setPauseVisionRecognition(boolean pause)
Allows to pause the image and code recognition.
void setPoseFilter(VDARPoseFilter poseFilter)
This method set the filter to be used to filter pose estimation algorithm.
void setPreventNotification(boolean v)
Set it to true to prevent any display of notification list, false otherwise.
void setRecognizableCode(EnumSet<VDARCodeType> recognizableCode)
Set the different type of codes the system should recognize if code detection is enabled
void setVisionContextIgnored(String contextID, boolean ignored)
Allows to enable / disable a vision context.
void startGPSNotifications()
Start a foreground service that listen to new nearby GPS points and create notifications for each new GPS point.
void startNearbyGPSDetection(long minGPSIntervalMS, float minGPSDistance, int detectionInterval, float maxDetectionRadius)
Start the detection of new nearby gps points using custom parameters.
void startNearbyGPSDetection()
Start the detection of nearby gps points.
final static VDARSDKController startSDK(Activity activity, String localDBDir, String apiKey)
Create a new instance of SDK Controller (if one doesn't already exists) and start loading the local AR DB asynchronously.
final static VDARSDKController startSDK(Context androidContext, String localDBDir, String apiKey)
Create a new instance of SDK Controller (if one doesn't already exists) and start loading the local AR DB asynchronously.
void stopGPSNotifications()
Stop the foreground service sending notification when new nearby GPS points are detected.
void stopNearbyGPSDetection()
Stop the detection of new nearby gps points.
void unbindService(ServiceConnection connection)
void unloadAll()
Remove and unload all the content that is displayed in the AR view
void unregisterContentEventReceiver(VDARContentEventReceiver receiver)
Unregister a previously registered event observer.
void unregisterEventReceiver(VDARSDKControllerEventReceiver receiver)
Unregister a previously registered event observer.
void unregisterSensorEventReceiver(VDARSDKSensorEventReceiver receiver)
Unregister a previously registered sensor event observer.
void updatePushNotificationToken(String token)
Updates the FCM token used for the push notifications.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.app.Application.ActivityLifecycleCallbacks
From interface com.vidinoti.android.vdarsdk.VDARImageReceiver

Constants

public static final int ImageStreamTypeSize

Constant Value: 2 (0x00000002)

public static final String SDK_START_INTENT

Constant Value: "com.vidinoti.vdarsdk.android.START_SDK"

Fields

public static int CAMERA_REQUEST_ID

ID of the camera permission request that is used by PixLive SDK

public static int EXTERNAL_STORAGE_REQUEST_ID

ID of the external storage permission request that is used by PixLive SDK

public static int LOCALIZATION_GPSNOTIFICATIONS_REQUEST_ID

ID of the localization permission request that is used by PixLive SDK for GPS Notifications

public static int LOCALIZATION_REQUEST_ID

ID of the localization permission request that is used by PixLive SDK

Public Methods

public void addNewAfterLoadingTask (Runnable t)

Run the provided task after the vision is system is loaded.

When the VDARSDKController is started using the startSDK method, the system is loading the necessary data for image recognition in the background. Before the loading process is over, it is not safe to call the large majority of methods dealing with the vision system. Therefore, this method can be used to launch a task after the loading process is over.

One would typically add a runnable with the user interface init function so that the user interface is updated when the loading process is over. The typical loading time varies between 100ms and 2-3 sec.

Parameters
t The task (Runnable) to run.

public void askForNearbyRequirements ()

Check if the bluetooth is set and localisation is enabled. Ask to enable if needed.

public void autofocus ()

Request the connected camera to trigger the autofocus mechanism.

public boolean bindService (Intent intent, ServiceConnection connection, int mode)

public void disableContext (String contextID)

Disables the context. The context remains local but won't be detected (its sensors are unregistered).

Parameters
contextID the ID of the context to disable

public void disableContexts ()

Disables all the contexts. The context remains on the device but their sensors are unregistered.

public void enableContext (String contextID)

Enables the context that has been disabled (see disableContext(String)).

Parameters
contextID the ID of the context to enable.

public void enableContextsWithTags (List<String> tags)

Enables all contexts belonging to specific tags. Ensure that the mapping Context <-> Tag exists otherwise no context will be enabled. The mapping Context-Tag must be retrieved using syncTagContexts(List, VDARRemoteController.Callback)

Parameters
tags a list of tag names. The context to enable must have all of the given tags (logical AND)

public void forceLanguage (String languageCode)

Sets the language of the SDK interface. By default, the SDK uses the phone language. If this method is called, it uses the given language instead. Call this method with null, for cancelling the forced language.

Parameters
languageCode the language code (2 lowercase characters, e.g. "fr")

public String generateDeviceReport (VDARImageSender camera, String errorDetails)

Generate a device report. This method is used internally for debugging.

Parameters
camera The camera device
errorDetails Details about the error on why this report should be generated
Returns
  • A device report

public String getAPIKey ()

The current API key used by the SDK

public VDARAjaxAppDataProvider getAjaxAppDataProvider ()

Get the provider that will give special data to the annotation subsystem when an Ajax request is generated with the APP HTTP method type.

Returns
  • the currently set provider

public ArrayList<String> getAllContextIDs ()

Return all the local contexts IDs contained in the local AR DB.

Returns
  • A vector containing all the local contexts IDs contained in the local AR DB as long elements.

public static Context getAndroidActivity ()

Return the current Android activity used to perform OS tasks like opening a browser or making the device vibrating. You have to keep the current android activity up to date by calling setActivity(Activity) when the activity changes.

Returns
  • the current Android activity used to perform OS tasks like opening a browser or making the device vibrating.

public Context getApplicationContext ()

public String getCloudRecognitionLanguage ()

Returns the language that should be used for the cloud recognition. If it returns null, then the phone language must be used.

Returns
  • the language that should be used for the cloud recognition (2-character iso code like "fr" or "en")

public VDARContext getContext (String remoteID)

Return the context associated with the local AR DB ID passed in parameter

Parameters
remoteID The remote ID of the context
Returns
  • The context corresponding to the passed ID

public Class<? extends Activity> getCustomWebviewActivityClass ()

Return the activity which will be launched when a web view has to be presented.

Returns
  • the activity which will be launched when a web view has to be presented.

public String getDeviceUUID ()

Return the Unique identifier of the device

Returns
  • the Unique identifier of the device

public static final VDARSDKController getInstance ()

Return the singleton instance of the SDK Controller.

Returns
  • the singleton instance of the SDK Controller.

public VDARLocalizationManager getLocalizationManager ()

Return the localization manager to provide location capabilities

Returns
  • the localization manager to provide location capabilities

public long getNbModelsInDB ()

Return the number of contexts that the system has in memory and is capable of recognizing. Returns -1 if the system is not yet initialized.

Returns
  • The number of contexts in the local AR DB, -1 if the system is not loaded.

public List<String> getNearbyBeacons ()

Returns the list of context ID of nearby beacons

Returns
  • le list of context ID nearby beacons

public VDARNearbyGPSManager getNearbyGPSManager ()

Return the nearby gps manager to provide list of new gps points nearby

Returns
  • the nearby gps manager to provide list of new gps points nearby

public HashMap<StringString> getNearbyStatus ()

Returns the list of context ID of nearby beacons

Returns
  • le list of context ID nearby beacons

public NotificationFactory getNotificationFactory ()

public ArrayList<ContextNotification> getPendingNotifications ()

Return the currently available notifications, that are not acknowledged neither ignored, that have been posted while the application was / is alive.

Returns
  • A list of ContextNotification objects representing all the notification posted.

public synchronized EnumSet<VDARCodeType> getRecognizableCode ()

Return the different type of codes the system will recognize if code detection is enabled.

Returns
  • the different type of codes the system will recognize if code detection is enabled.

public static String getSDKVersion ()

Return the SDK current version number

Returns
  • the SDK current version number

public boolean isBookmarkSupportEnabled ()

Returns
  • true if the bookmark feature is enabled (default: false)

public synchronized boolean isCodesRecognitionEnabled ()

Returns wether or not the system performs QR code and similar codes recognition.

Returns
  • true if code recognition is enabled, false otherwise.

public static boolean isContainingBeacons ()

Return YES if the app contain GPS points, NO otherwise

Returns
  • YES if the app contain GPS points, NO otherwise

public static boolean isDeviceSupported ()

Return true if the device is supported and can run VDARSDK, false otherwise.

Returns
  • true if the device is supported and can run VDARSDK, false otherwise.

public boolean isLoaded ()

Return true if the local AR DB is loaded, false if it is currently being loaded.

Returns
  • true if the local AR DB is loaded, false if it is currently being loaded.

public boolean isNotificationSupportEnabled ()

Return true or false depending if the notification support is enabled.

Returns
  • true or false depending if the notification support is enabled

public boolean isPauseVisionRecognition ()

True if the vision recognition is currently paused (image and code recognition), false otherwise.

Returns
  • the vision recognition pause status.

public boolean isTablet ()

public static void log (int priority, String tag, String msg)

Write a log message to the console. Also output it to crashlytics if available.

Parameters
priority Priority of log
tag The tag of log
msg The log message

public void onActivityCreated (Activity activity, Bundle savedInstanceState)

public void onActivityDestroyed (Activity activity)

public void onActivityPaused (Activity activity)

public void onActivityResumed (Activity activity)

public void onActivitySaveInstanceState (Activity activity, Bundle outState)

public void onActivityStarted (Activity activity)

public void onActivityStopped (Activity activity)

public void onBeaconServiceConnect ()

public void onNewIntent (Intent intent)

Notify the SDK of a new intent. Intent could be launched by push notification or notifications. and will react accordingly. An intent can handle a push notification by containing the nid of the push notification and a boolean specifying if it is remote or not. An intent can also open a context, by having a type of contextID and a type of openContext.

Parameters
intent the intent passed from the application

public void onRequestPermissionsResult (int requestCode, String[] permissions, int[] grantResults)

This method should be called by your activity whenever this method is called on your activity

Parameters
requestCode The request code that is passed by the system
permissions The requested permissions
grantResults The request result

public void openURLInInternalBrowser (URL url)

Open the given URL in the internal browser embedded in the VDARSDK

Parameters
url The URL to open

public void playAR (String url)

Open the ARCore scanner with integrated webview. If ARCore is not supported, the webview is opened without the camera and the AR tracking.

Parameters
url the URL that must be loaded by the web view

public void presentNearbyList ()

Presents a list with the "nearby" beacons.

public void presentNearbyList (float latitude, float longitude)

Presents a list with the "nearby" elements. The elements can either be GPS points or beacons. If the latitude and longitude are both 0, it means that the localization is still pending and a loading wheel (progress bar) will be displayed.

Parameters
latitude the latitude of the current location
longitude the longitude of the current location

public void presentNotificationsList ()

Display the default notification list

public void previewContext (String contextID, Observer callback)

The preview of the passed context is shown. The context image has to be loaded from the network, therefore the completion block can be used in order to know when the fetch is completed and the preview is started.

Pass null for the context argument to stop the preview.

Parameters
contextID The id of context to preview or null to stop the currently playing preview.
callback The block that will be called when the preview is started. Can be null.

public void processNewImageFrame (VDARFrame openGLFrame, double currentTime)

When calling this method, the implemented class will use that new image frame to update its own recognition pipeline with the image content.

Warning: You must not call this method within different frames concurrently!

Parameters
openGLFrame The new image frame. Note that the image should be locked since version 2.0.0b2 before passing it to this method (i.e. call image.lock() or image.trylock())
currentTime The time at which the frame was captured. (Since Version 3.0.2)

public void processNotification (String notification, boolean remote)

Process and execute the action residing in the notification received by the device.

You should call this method with the notification id passed as a parameter to the Intent of the notification service named nid.

Parameters
notification The notification ID, can be retrieved using the nid key on the Intent's extra settings bundle.
remote Whether the notification has been remotely received or is a local one due to a local event

public void refreshNearbyList (float latitude, float longitude)

Updates the list with "nearby" elements if it is visible. The list contains both GPS points and beacons. By giving, latitude and longitude, a new request of nearby GPS point will be executed.

Parameters
latitude the latitude of the current location
longitude the longitude of the current location

public void registerContentEventReceiver (VDARContentEventReceiver receiver)

Register a new object to receive event from the content Multiple receivers are supported.

Parameters
receiver The object to call the events methods on.

public void registerEventReceiver (VDARSDKControllerEventReceiver receiver)

Register a new object to receive event from the augmented reality system. The events can be used to detect wether or not a context has been detected. Multiple receivers are supported.

Parameters
receiver The object to call the events methods on.

public void registerSensorEventReceiver (VDARSDKSensorEventReceiver receiver)

Register a new object to receive event from the sensor system. The events can be used to detect wether or not an image / beacon has been detected Multiple receivers are supported.

Parameters
receiver The object to call the events methods on.

public void releaseCamera ()

Releases the camera. Call this from the onDestroy method of the activity running the camera.

public void releaseMemory ()

Force the VDARSDK subsystems to release as much memory as they can. This should be called when a low memory event occurs on your Activity.

public void runInRenderingThread (Runnable r)

This method is used internally and should not be called. Doing so results in unexpected behavior.

Parameters
r This method is used internally and should not be called. Doing so results in an unexpected behavior.

public static void runOnUiThread (Runnable r)

Run the specific Runnable on the UI Thread

Parameters
r the runnable to run on the UI thread

public boolean save ()

Save the current local AR DB

Returns
  • true in case of success, false otherwise.

public void setARViewOpenEventListener (ARViewOpenEventListener listener)

When a content needing the AR view to be opened is triggered, usually due to a beacon event, the app needs to open the AR view. By default, the SDK takes care of that. It opens the AR view if not already opened, or display the content directly if the AR view is open.

You can prevent this functionality by setting a listener and implementing your own logic in that listener. An AR should be open as soon as the notification VDARNotificationARViewRequested is triggered.

By default, it is set to YES.

public void setActivity (Activity activity)

Set the current activity using the VDARSDK.

This is needed before the rendering start otherwise it will yield to application crash.

Parameters
activity The current activity

public void setAjaxAppDataProvider (VDARAjaxAppDataProvider ajaxAppDataProvider)

Set the provider that will give special data to the annotation subsystem when an Ajax request is generated with the APP HTTP method type.

Parameters
ajaxAppDataProvider the provider to set

public void setAppForeground (boolean isAppForeground)

If the SDK is started after the app is created, it cannot know if the app is started or not. This method allows the app developer to tell the SDK the app is currently in foreground and started.

Parameters
isAppForeground true if app is in foreground (any activities), false otherwise.

public void setBookmarkSupport (boolean enabled)

Enables the support of bookmarks. When enabled, a bookmark icon will be displayed in the content toolbar. The content can be added or removed from the content by clicking the toolbar icon.

Parameters
enabled true for enabling the bookmark feature (default: false)

public void setCloudRecognitionLanguage (String cloudRecognitionLanguage)

Forces the language to be used for the cloud recognition

Parameters
cloudRecognitionLanguage the language to use (2-character iso code like "fr" or "en")

public void setCustomPdfViewer (PDFRequestHandler pdfRequestHandler)

Defines a custom PDF viewer. If set, it replaces the default PDF viewer.

Parameters
pdfRequestHandler the handler called when a PDF file must be displayed.

public void setCustomWebviewActivityClass (Class<? extends Activity> c)

Set the activity which should be started when the internal web browser has to be opened for a web page.

The activity should use the class VDARWebView for displaying web content and not the default Android WebView as it includes special handling methods for displaying menus.

Parameters
c The new class to use for displaying a web browser. Setting it to null will restore the default browser.

public void setDeviceOrientation (VDARDeviceOrientation d)

Set the current device orientation.

The orientation has to be changed when the device rotate otherwise the recognition won't work correctly.

Parameters
d The new device orientation.

public void setDisplayModelDebugOverlay (boolean showOverlay)

Set wether or not to display an overlow displaying where the context has been detected.

Parameters
showOverlay true if the overlay has to be shown, false otherwise.

public void setEnableCodesRecognition (boolean enableCodesRecognition)

Whether or not to enable codes (such as QR codes) recognition.

When set to true, code recognition is also performed while trying to recognize a VDARContext.

Code recognition allows you to recognize different type of codes (1-D codes such as a barcodes or 2D codes such as QR Codes). Those codes can contains any information they can support. When a code is detected, the onCodesRecognized(ArrayList) method of all the VDARSDKController event receivers is called with the detected codes represented as VDARCode objects. You can then use the returned objects to read the codes data and act upon it.

You can use the QR Code generator available in Vidinoti AR Manager under My Contents -> Code Generator to generate your own QR Codes.

Several different special QR Codes are understood by the system. Those special QR codes actually contain a special URL. To be understood correctly, this special URL has to be of the following format:

 vdarsdk:////.../<parameter n>
 

The following commands are supported:

  1. Context Download QR Code (command = mdl)

    This special QR Code can trigger the download (a.k.a pre-fetch) of a VDARContext so that the VDARContext can be recognized afterhand. Those special QR codes should contains an URL of the following format:

     vdarsdk://mdl/
     

    For example, if you have a context with the remote ID fsgdg4t3few, then you can create a QR code with this URL vdarsdk://mdl/fsgdg4t3few to automatically trigger the download of the corresponding context.

  2. Tag synchrnoization request (command = tsc)

    This special QR Code can trigger the synchronization request (a.k.a pre-fetch) of several VDARContext objects corresponding to a given or multiple tags. Those special QR codes should contains an URL of the following format:

     vdarsdk://tsc///.../<tag n>
     

    For example, if you want to synchronize the local AR DB with all the contexts having the tags hello and bye, then you can create a QR code with this URL vdarsdk://tsc/hello/bye to automatically trigger the download of the corresponding contexts.

    Note that the code recognition is automatically disabled when a VDARContext has been recognized and when it is tracked.

    You can customize which codes can be recognized by using the setRecognizableCode(EnumSet) method.

Parameters
enableCodesRecognition the enableCodesRecognition to set

public void setEnableDefaultNotificationController (boolean val)

When a notification arrives in a state where the application is open, the SDK will handle it and display a list of context the user can choose. You can disable this behaviour by setting this flag to NO. By default, it is set to YES.

Parameters
val If truem the SDK handles the notification, otherwise it is up to the app.

public void setEnableNearbyRequirementDialog (boolean enable)

Enables/disables the nearby requirement dialog asking for bluetooth/localisation requirement If enabled, a dialog will ask the user to enabled the required settings for bluetooth and localisation when the SDK start to scan for beacons. By default, this is enabled.

Parameters
enable true for enabling the dialog, false otherwise

public void setEnablePendingNotifications (boolean enable)

Enables/disables the pending notification list when a beacon notification is received. If enabled, the list will contain all beacon notification list that have been received and not displayed or dismissed. If disabled, only the beacon notification will be displayed. By default, this is disabled (a simple popup with the beacon notification will be displayed instead of a list of pending notifications).

Parameters
enable true for enabling the notification list for the beacon notification, false for displaying a single popup instead.

public void setImageSender (VDARImageSender camera)

Set the current image sender (i.e. camera) to be used with the system. This should be used in favor of VDARImageSender.setImageReceiver as this is deprecated.

Parameters
camera The image sender to use from now on.

public void setLicenseKey (String licenseKey)

Allows changing the license key when the SDK is already running. The new license key will be validated against the server.

Parameters
licenseKey the new license key.

public void setNotificationFactory (NotificationFactory creator)

Set the notification creator used to create a notification when, for example, a beacon is detected.

Parameters
creator The creator to use for creating notification.

public void setNotificationsSupport (boolean enabled)

Enable / Disable app push notification support

Parameters
enabled If true, notifications are enabled, false otherwise

public void setNotificationsSupport (boolean enabled, String senderID)

This method is deprecated.
the senderID is not needed anymore, use setNotificationsSupport(boolean)

Enable / Disable app notification support

Parameters
enabled If true, notifications are enabled, false otherwise
senderID The sender ID (API project number in Google API website)

public void setPauseVisionRecognition (boolean pause)

Allows to pause the image and code recognition. The camera still receives and displays frames but they are not sent to the vision engine.

Parameters
pause true to pause the vision recognition, false otherwise.

public void setPoseFilter (VDARPoseFilter poseFilter)

This method set the filter to be used to filter pose estimation algorithm.

This is an advanced method and should not be used for general purpose applications.

Parameters
poseFilter The new filter to use

public void setPreventNotification (boolean v)

Set it to true to prevent any display of notification list, false otherwise. False by default.

Parameters
v True to prevent any display of notification list, false otherwise. False by default.

public void setRecognizableCode (EnumSet<VDARCodeType> recognizableCode)

Set the different type of codes the system should recognize if code detection is enabled

Parameters
recognizableCode the recognizableCode to set

public void setVisionContextIgnored (String contextID, boolean ignored)

Allows to enable / disable a vision context. If the vision context is ignored, it won't be recognized, even if it is present locally. By default, the vision contexts are not ignored.

Parameters
contextID the context ID
ignored true if the context must be ignored (i.e. not recognized), false otherwise.

public void startGPSNotifications ()

Start a foreground service that listen to new nearby GPS points and create notifications for each new GPS point. You have to manually startNearbyGPSDetection otherwise nothing will be received by the foreground service and no notification will be created.

public void startNearbyGPSDetection (long minGPSIntervalMS, float minGPSDistance, int detectionInterval, float maxDetectionRadius)

Start the detection of new nearby gps points using custom parameters. Implement VDARNearbyGPSManagerEventReceiver to be notified of every new gps point near the user. As this gets the user position frequently you should not forget to stop it when it is not used.

Parameters
minGPSIntervalMS the minimal time between the user position is fetched
minGPSDistance the minimal distance the user has to move before it is considered as a new position
detectionInterval after how long a gps point is reconsidered as new
maxDetectionRadius the maximal detection radius

public void startNearbyGPSDetection ()

Start the detection of nearby gps points. Implement VDARNearbyGPSManagerEventReceiver to be notified of every new gps point near the user. As this gets the user position frequently you should not forget to stop it when it is not used.

public static final VDARSDKController startSDK (Activity activity, String localDBDir, String apiKey)

Create a new instance of SDK Controller (if one doesn't already exists) and start loading the local AR DB asynchronously.

Warning: You must call this method before calling anything else from the PixLive SDK.

Parameters
activity The current activity the system should use to make system tasks
localDBDir The directory at which to store the local AR DB
apiKey The API key corresponding to your license
Returns
  • a new started VDARSDKController instance, or the same one if already started.

public static final VDARSDKController startSDK (Context androidContext, String localDBDir, String apiKey)

Create a new instance of SDK Controller (if one doesn't already exists) and start loading the local AR DB asynchronously.

Warning: You must call this method before calling anything else from the PixLive SDK.

Parameters
androidContext The current Android context the system should use to make system tasks
localDBDir The directory at which to store the local AR DB
apiKey The API key corresponding to your license
Returns
  • a new started VDARSDKController instance, or the same one if already started.

public void stopGPSNotifications ()

Stop the foreground service sending notification when new nearby GPS points are detected.

public void stopNearbyGPSDetection ()

Stop the detection of new nearby gps points.

public void unbindService (ServiceConnection connection)

public void unloadAll ()

Remove and unload all the content that is displayed in the AR view

public void unregisterContentEventReceiver (VDARContentEventReceiver receiver)

Unregister a previously registered event observer.

Parameters
receiver The receiver to unregister

public void unregisterEventReceiver (VDARSDKControllerEventReceiver receiver)

Unregister a previously registered event observer.

Parameters
receiver The receiver to unregister

public void unregisterSensorEventReceiver (VDARSDKSensorEventReceiver receiver)

Unregister a previously registered sensor event observer.

Parameters
receiver The receiver to unregister

public void updatePushNotificationToken (String token)

Updates the FCM token used for the push notifications. This method must be called every time that the FCM token is renewed (the application must implement a FirebaseInstanceIdService and call this method every time that the method onTokenRefresh is called).

Parameters
token the Firebase token