public class LayarSDKClient
extends java.lang.Object
| Constructor and Description |
|---|
LayarSDKClient() |
| Modifier and Type | Method and Description |
|---|---|
int |
getIconResource(Context context) |
LayarSDKFragment |
getSdkFragment()
Get the
LayarSDKFragment instance this SDK client is working on. |
void |
onActionTriggered(Layer layer,
Poi poi,
Action action)
Notify the host application that an action has been triggered.
|
void |
onAugmentClicked(Layer layer,
Poi poi)
Notify the host application that an augment has been clicked.
|
void |
onAugmentFocused(Layer layer,
Poi poi)
Notify the host application that an augment was focused (rendered closest to the center of the screen).
|
void |
onAugmentShown(Layer layer,
Poi poi)
Notify the host application that an augment was rendered on screen.
|
boolean |
onBackPressed()
Allows the host application to intercept the back button.
|
void |
onContentVisible(boolean contentVisible)
Notify the host application that content is visible in the AR or detached view.
|
void |
onCreateOptionsMenu(Menu menu)
Give the host application the possibility to insert its own items to the menu.
|
void |
onLayerLaunched(Layer layer,
java.lang.String referenceImageId)
Notify the host application that a layer was loaded.
|
boolean |
onOptionsItemSelected(MenuItem item)
Notify the host application that a menu item was selected.
|
void |
onPopOutClosed(Layer layer,
java.lang.String referenceImageId)
Notify the host application that the pop-out view was closed.
|
void |
onPopOutTriggered(Layer layer,
java.lang.String referenceImageId)
Notify the host application that the pop-out view has been triggered.
|
void |
onQRCodeRecognized(java.lang.String qrCodeData)
Notify the host application that a QR code was recognized.
|
void |
onReferenceImageLost(Layer layer,
java.lang.String referenceImageId)
Notify the host application that a reference image was lost.
|
void |
onReferenceImageTracked(Layer layer,
java.lang.String referenceImageId)
Notify the host application that a reference image is tracked.
|
void |
onScreenshotModeClosed()
Notify the host application that the user has closed the screenshot mode.
|
void |
onScreenshotModeOpened()
Notify the host application that the user has opened the screenshot mode.
|
void |
onVideoPlaybackStarted(Layer layer,
Poi poi)
Notify the host application that a video augment has been played (either in AR or in a full screen view).
|
void |
onVisualSearchResult(int responseCode,
java.lang.String responseMessage,
VisualSearchResult[] results)
Notify the host application of the results of a visual search query.
|
boolean |
shouldPerformVisualSearch(java.io.File queryImage)
Give the host application a chance to inspect the query image before
doing a Layar visual search query.
|
boolean |
shouldShowNoResultsFound(java.io.File queryImage)
Give the host application a chance to suppress the display of the no
results found message.
|
boolean |
shouldTriggerAction(Layer layer,
Poi poi,
Action action)
Give the host application to prevent actions from being triggered by the
Layar SDK.
|
public void onQRCodeRecognized(java.lang.String qrCodeData)
qrCodeData - The data string that was decoded from the QR code.public boolean shouldPerformVisualSearch(java.io.File queryImage)
queryImage - The query image file captured by the user.public void onVisualSearchResult(int responseCode,
java.lang.String responseMessage,
VisualSearchResult[] results)
responseCode - The response code for the API call, 0 = okresponseMessage - The response message for the API callresults - Array with the visual search results. Empty array when no
results were foundpublic boolean shouldShowNoResultsFound(java.io.File queryImage)
queryImage - The image file used in the visual search query.public void onLayerLaunched(Layer layer, java.lang.String referenceImageId)
layer - The layer that has been launched in the Layar SDK.referenceImageId - public void onReferenceImageTracked(Layer layer, java.lang.String referenceImageId)
layer - The layer this reference image belongs to.referenceImageId - The unique reference image id of the image that is being
tracked.public void onReferenceImageLost(Layer layer, java.lang.String referenceImageId)
layer - The layer this reference image belongs to.referenceImageId - The unique reference image id of the image that was lost.public void onAugmentShown(Layer layer, Poi poi)
layer - The layer this augment belongs topoi - The poi representing the augmentpublic void onAugmentClicked(Layer layer, Poi poi)
layer - The layer this augment belongs topoi - The poi representing the augmentpublic void onAugmentFocused(Layer layer, Poi poi)
layer - The layer this augment belongs topoi - The poi representing the augmentpublic void onContentVisible(boolean contentVisible)
contentVisible - public void onVideoPlaybackStarted(Layer layer, Poi poi)
layer - The layer this augment belongs topoi - The poi representing the augmentpublic boolean shouldTriggerAction(Layer layer, Poi poi, Action action)
layer - poi - action - public void onActionTriggered(Layer layer, Poi poi, Action action)
layer - poi - action - public void onPopOutTriggered(Layer layer, java.lang.String referenceImageId)
layer - referenceImageId - public void onPopOutClosed(Layer layer, java.lang.String referenceImageId)
layer - referenceImageId - public void onCreateOptionsMenu(Menu menu)
menu - public boolean onOptionsItemSelected(MenuItem item)
onCreateOptionsMenu.item - public boolean onBackPressed()
public void onScreenshotModeOpened()
public void onScreenshotModeClosed()
public LayarSDKFragment getSdkFragment()
LayarSDKFragment instance this SDK client is working on. Useful for implementing your own user
interface controls, or to get access to the Activity for handling intercepted actions.public int getIconResource(Context context)