java.lang.Object | |
↳ | com.vidinoti.android.vdarsdk.VDARSDKController |
The context manager orchestrating all the Vidinoti AR system. It accecpts frame to process them and manage the local AR DB
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | ImageStreamTypeSize | ||||||||||
String | SDK_START_INTENT |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CAMERA_REQUEST_ID | ID of the camera permission request that is used by PixLive SDK | ||||||||||
EXTERNAL_STORAGE_REQUEST_ID | ID of the external storage permission request that is used by PixLive SDK | ||||||||||
LOCALIZATION_GPSNOTIFICATIONS_REQUEST_ID | ID of the localization permission request that is used by PixLive SDK for GPS Notifications | ||||||||||
LOCALIZATION_REQUEST_ID | ID of the localization permission request that is used by PixLive SDK |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Run the provided task after the vision is system is loaded.
| |||||||||||
Check if the bluetooth is set and localisation is enabled.
| |||||||||||
Request the connected camera to trigger the autofocus mechanism.
| |||||||||||
Disables the context.
| |||||||||||
Disables all the contexts.
| |||||||||||
Enables the context that has been disabled
(see
disableContext(String) ). | |||||||||||
Enables all contexts belonging to specific tags.
| |||||||||||
Sets the language of the SDK interface.
| |||||||||||
Generate a device report.
| |||||||||||
The current API key used by the SDK
| |||||||||||
Get the provider that will give special data to the annotation subsystem when an Ajax request is generated with the APP HTTP method type.
| |||||||||||
Return all the local contexts IDs contained in the local AR DB.
| |||||||||||
Return the current Android activity used to perform OS tasks like opening
a browser or making the device vibrating.
| |||||||||||
Returns the language that should be used for the cloud recognition.
| |||||||||||
Return the context associated with the local AR DB ID passed in
parameter
| |||||||||||
Return the activity which will be launched when a web view has to be
presented.
| |||||||||||
Return the Unique identifier of the device
| |||||||||||
Return the singleton instance of the SDK Controller.
| |||||||||||
Return the localization manager to provide location capabilities
| |||||||||||
Return the number of contexts that the system has in memory and is
capable of recognizing.
| |||||||||||
Returns the list of context ID of nearby beacons
| |||||||||||
Return the nearby gps manager to provide list of new gps points nearby
| |||||||||||
Returns the list of context ID of nearby beacons
| |||||||||||
Return the currently available notifications, that are not acknowledged neither ignored, that have been posted while the application was / is alive.
| |||||||||||
Return the different type of codes the system will recognize if code
detection is enabled.
| |||||||||||
Return the SDK current version number
| |||||||||||
Returns wether or not the system performs QR code and similar codes
recognition.
| |||||||||||
Return YES if the app contain GPS points, NO otherwise
| |||||||||||
Return true if the device is supported and can run VDARSDK, false otherwise.
| |||||||||||
Return true if the local AR DB is loaded, false if it is currently being
loaded.
| |||||||||||
Return true or false depending if the notification support is enabled.
| |||||||||||
True if the vision recognition is currently paused (image and code recognition), false otherwise.
| |||||||||||
Write a log message to the console.
| |||||||||||
Notify the SDK of a new intent.
| |||||||||||
This method should be called by your activity whenever this method is called on your activity
| |||||||||||
Open the given URL in the internal browser embedded in the VDARSDK
| |||||||||||
Open the ARCore scanner with integrated webview.
| |||||||||||
Presents a list with the "nearby" beacons.
| |||||||||||
Presents a list with the "nearby" elements.
| |||||||||||
Display the default notification list
| |||||||||||
The preview of the passed context is shown.
| |||||||||||
When calling this method, the implemented class will use that new image
frame to update its own recognition pipeline with the image content.
| |||||||||||
Process and execute the action residing in the notification received by
the device.
| |||||||||||
Updates the list with "nearby" elements if it is visible.
| |||||||||||
Register a new object to receive event from the content
Multiple receivers are supported.
| |||||||||||
Register a new object to receive event from the augmented reality system.
| |||||||||||
Register a new object to receive event from the sensor system.
| |||||||||||
Releases the camera.
| |||||||||||
Force the VDARSDK subsystems to release as much memory as they can.
| |||||||||||
This method is used internally and should not be called.
| |||||||||||
Run the specific Runnable on the UI Thread
| |||||||||||
Save the current local AR DB
| |||||||||||
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.
| |||||||||||
Set the current activity using the VDARSDK.
| |||||||||||
Set the provider that will give special data to the annotation subsystem when an Ajax request is generated with the APP HTTP method type.
| |||||||||||
If the SDK is started after the app is created, it cannot know if the app is started or not.
| |||||||||||
Enables the support of bookmarks.
| |||||||||||
Forces the language to be used for the cloud recognition
| |||||||||||
Defines a custom PDF viewer.
| |||||||||||
Set the activity which should be started when the internal web browser
has to be opened for a web page.
| |||||||||||
Set the current device orientation.
| |||||||||||
Set wether or not to display an overlow displaying where the context has
been detected.
| |||||||||||
Whether or not to enable codes (such as QR codes) recognition.
| |||||||||||
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.
| |||||||||||
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.
| |||||||||||
Enables/disables the pending notification list when a beacon notification is received.
| |||||||||||
Set the current image sender (i.e.
| |||||||||||
Allows changing the license key when the SDK is already running.
| |||||||||||
Set the notification creator used to create a notification when, for example, a beacon is detected.
| |||||||||||
Enable / Disable app push notification support
| |||||||||||
This method is deprecated.
the senderID is not needed anymore, use
setNotificationsSupport(boolean)
| |||||||||||
Allows to pause the image and code recognition.
| |||||||||||
This method set the filter to be used to filter pose estimation
algorithm.
| |||||||||||
Set it to true to prevent any display of notification list, false otherwise.
| |||||||||||
Set the different type of codes the system should recognize if code
detection is enabled
| |||||||||||
Allows to enable / disable a vision context.
| |||||||||||
Start a foreground service that listen to new nearby GPS points and create notifications for each
new GPS point.
| |||||||||||
Start the detection of new nearby gps points using custom parameters.
| |||||||||||
Start the detection of nearby gps points.
| |||||||||||
Create a new instance of SDK Controller (if one doesn't already exists)
and start loading the local AR DB asynchronously.
| |||||||||||
Create a new instance of SDK Controller (if one doesn't already exists)
and start loading the local AR DB asynchronously.
| |||||||||||
Stop the foreground service sending notification when new nearby GPS points are detected.
| |||||||||||
Stop the detection of new nearby gps points.
| |||||||||||
Remove and unload all the content that is displayed in the AR view
| |||||||||||
Unregister a previously registered event observer.
| |||||||||||
Unregister a previously registered event observer.
| |||||||||||
Unregister a previously registered sensor event observer.
| |||||||||||
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
|
ID of the camera permission request that is used by PixLive SDK
ID of the external storage permission request that is used by PixLive SDK
ID of the localization permission request that is used by PixLive SDK for GPS Notifications
ID of the localization permission request that is used by PixLive SDK
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.
t | The task (Runnable) to run. |
---|
Check if the bluetooth is set and localisation is enabled. Ask to enable if needed.
Request the connected camera to trigger the autofocus mechanism.
Disables the context. The context remains local but won't be detected (its sensors are unregistered).
contextID | the ID of the context to disable |
---|
Disables all the contexts. The context remains on the device but their sensors are unregistered.
Enables the context that has been disabled
(see disableContext(String)
).
contextID | the ID of the context to enable. |
---|
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)
tags | a list of tag names. The context to enable must have all of the given tags (logical AND) |
---|
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.
languageCode | the language code (2 lowercase characters, e.g. "fr") |
---|
Generate a device report. This method is used internally for debugging.
camera | The camera device |
---|---|
errorDetails | Details about the error on why this report should be generated |
Get the provider that will give special data to the annotation subsystem when an Ajax request is generated with the APP HTTP method type.
Return all the local contexts IDs contained in the local AR DB.
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 language that should be used for the cloud recognition. If it returns null, then the phone language must be used.
Return the context associated with the local AR DB ID passed in parameter
remoteID | The remote ID of the context |
---|
Return the activity which will be launched when a web view has to be presented.
Return the Unique identifier of the device
Return the singleton instance of the SDK Controller.
Return the localization manager to provide location capabilities
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 list of context ID of nearby beacons
Return the nearby gps manager to provide list of new gps points nearby
Returns the list of context ID of nearby beacons
Return the currently available notifications, that are not acknowledged neither ignored, that have been posted while the application was / is alive.
Return the different type of codes the system will recognize if code detection is enabled.
Return the SDK current version number
Returns wether or not the system performs QR code and similar codes recognition.
Return YES if the app contain GPS points, NO otherwise
Return true if the device is supported and can run VDARSDK, false otherwise.
Return true if the local AR DB is loaded, false if it is currently being loaded.
Return true or false depending if the notification support is enabled.
True if the vision recognition is currently paused (image and code recognition), false otherwise.
Write a log message to the console. Also output it to crashlytics if available.
priority | Priority of log |
---|---|
tag | The tag of log |
msg | The log message |
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.
intent | the intent passed from the application |
---|
This method should be called by your activity whenever this method is called on your activity
requestCode | The request code that is passed by the system |
---|---|
permissions | The requested permissions |
grantResults | The request result |
Open the given URL in the internal browser embedded in the VDARSDK
url | The URL to open |
---|
Open the ARCore scanner with integrated webview. If ARCore is not supported, the webview is opened without the camera and the AR tracking.
url | the URL that must be loaded by the web view |
---|
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.
latitude | the latitude of the current location |
---|---|
longitude | the longitude of the current location |
Display the default notification list
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.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. |
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!
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) |
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.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 |
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.
latitude | the latitude of the current location |
---|---|
longitude | the longitude of the current location |
Register a new object to receive event from the content Multiple receivers are supported.
receiver | The object to call the events methods on. |
---|
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.
receiver | The object to call the events methods on. |
---|
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.
receiver | The object to call the events methods on. |
---|
Releases the camera. Call this from the onDestroy method of the activity running the camera.
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.
This method is used internally and should not be called. Doing so results in unexpected behavior.
r | This method is used internally and should not be called. Doing so results in an unexpected behavior. |
---|
Run the specific Runnable on the UI Thread
r | the runnable to run on the UI thread |
---|
Save the current local AR DB
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.Set the current activity using the VDARSDK.
This is needed before the rendering start otherwise it will yield to application crash.
activity | The current activity |
---|
Set the provider that will give special data to the annotation subsystem when an Ajax request is generated with the APP HTTP method type.
ajaxAppDataProvider | the provider to set |
---|
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.
isAppForeground | true if app is in foreground (any activities), false otherwise. |
---|
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.
enabled | true for enabling the bookmark feature (default: false) |
---|
Forces the language to be used for the cloud recognition
cloudRecognitionLanguage | the language to use (2-character iso code like "fr" or "en") |
---|
Defines a custom PDF viewer. If set, it replaces the default PDF viewer.
pdfRequestHandler | the handler called when a PDF file must be displayed. |
---|
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.
c | The new class to use for displaying a web browser. Setting it to null will restore the default browser. |
---|
Set the current device orientation.
The orientation has to be changed when the device rotate otherwise the recognition won't work correctly.d | The new device orientation. |
---|
Set wether or not to display an overlow displaying where the context has been detected.
showOverlay | true if the overlay has to be shown, false otherwise. |
---|
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:
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.
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.
enableCodesRecognition | the enableCodesRecognition to set |
---|
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.
val | If truem the SDK handles the notification, otherwise it is up to the app. |
---|
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.
enable | true for enabling the dialog, false otherwise |
---|
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).
enable | true for enabling the notification list for the beacon notification, false for displaying a single popup instead. |
---|
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.
camera | The image sender to use from now on. |
---|
Allows changing the license key when the SDK is already running. The new license key will be validated against the server.
licenseKey | the new license key. |
---|
Set the notification creator used to create a notification when, for example, a beacon is detected.
creator | The creator to use for creating notification. |
---|
Enable / Disable app push notification support
enabled | If true, notifications are enabled, false otherwise |
---|
This method is deprecated.
the senderID is not needed anymore, use setNotificationsSupport(boolean)
Enable / Disable app notification support
enabled | If true, notifications are enabled, false otherwise |
---|---|
senderID | The sender ID (API project number in Google API website) |
Allows to pause the image and code recognition. The camera still receives and displays frames but they are not sent to the vision engine.
pause | true to pause the vision recognition, false otherwise. |
---|
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.poseFilter | The new filter to use |
---|
Set it to true to prevent any display of notification list, false otherwise. False by default.
v | True to prevent any display of notification list, false otherwise. False by default. |
---|
Set the different type of codes the system should recognize if code detection is enabled
recognizableCode | the recognizableCode to set |
---|
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.
contextID | the context ID |
---|---|
ignored | true if the context must be ignored (i.e. not recognized), false otherwise. |
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.
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.
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 |
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.
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.
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 |
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.
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 |
Stop the foreground service sending notification when new nearby GPS points are detected.
Stop the detection of new nearby gps points.
Remove and unload all the content that is displayed in the AR view
Unregister a previously registered event observer.
receiver | The receiver to unregister |
---|
Unregister a previously registered event observer.
receiver | The receiver to unregister |
---|
Unregister a previously registered sensor event observer.
receiver | The receiver to unregister |
---|
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).
token | the Firebase token |
---|