public class ZebraHud
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
ZebraHud.EventListener
Interface that defines events an activity can choose to listener for.
|
static class |
ZebraHud.HudCameraResolution
Camera resolution data.
|
static class |
ZebraHud.HudViewBinding
Return result from
showHudViewBinding(HudViewBinding), to support
Callers implementing the v3.6 View Binding feature. |
static interface |
ZebraHud.ImuListener
Interface for the IMU data event
|
| Modifier and Type | Field and Description |
|---|---|
static int |
BrightnessStepValue
Current brightness percent step-value
|
static int[] |
ListCamera720pFramerates
List of supported framerates for the 720p camera video.
|
static int |
ScaleStepValue
Current scale percent step-value
|
| Constructor and Description |
|---|
ZebraHud() |
| Modifier and Type | Method and Description |
|---|---|
void |
attachToContext(Context context,
ZebraHud.EventListener listener)
Interacting with the HUD without using the Android application lifecycle.
|
void |
clearDisplay()
Clear the HUD display.
|
View |
createHudView(int layout)
Create a View to be drawn on the HUD display.
|
void |
deinit(Application applicationContext)
Interacting with the HUD may be tied to your Android application lifecycle.
|
void |
detachFromContext(Context context,
java.lang.Boolean showInterrupt)
Interacting with the HUD without using the Android application lifecycle.
|
int |
getBrightness()
Get the HUD display brightness.
|
int |
getCamera720pFramerate()
Get the framerate of the 720p camera video.
|
java.util.List<ZebraHud.HudCameraResolution> |
getCameraAllResolutions()
Get the list of all supported camera resolutions.
|
ZebraHud.HudCameraResolution |
getCameraCurrentResolution()
Get the current camera resolution.
|
boolean |
getCameraEnabled()
Get the HUD camera state.
|
int |
getCameraZoom()
Get the camera digital zoom value, as a percentage.
|
java.lang.String |
getDeviceInfo()
Returns information about the current HUD device.
|
ZebraHud.HudViewBinding |
getHudViewBinding()
Create a View to be drawn on the HUD display, using the v3.6 View Binding feature.
|
boolean |
getImuStatus()
Get the status of the HUD IMU data streaming.
|
boolean |
getMicrophoneEnabled()
Get the HUD microphone state.
|
int |
getScale()
Get the HUD display scale.
|
java.lang.String |
getServiceVersion()
Returns the HUD service version.
|
void |
init(Application applicationContext)
Interacting with the HUD may be tied to your Android application lifecycle.
|
boolean |
isConnected() |
boolean |
isDisplayOn()
Get if the HUD display is on or off.
|
void |
onPause(Activity activity)
Interacting with the HUD is tied to your Android activity lifecycle.
|
void |
onResume(Activity activity,
ZebraHud.EventListener listener)
Interacting with the HUD is tied to your Android activity lifecycle.
|
void |
onStart(Activity activity)
Interacting with the HUD is tied to your Android activity lifecycle.
|
void |
onStop(Activity activity,
java.lang.Boolean showInterrupt)
Interacting with the HUD is tied to your Android activity lifecycle.
|
void |
setBrightness(int percent)
Set the HUD display brightness.
|
void |
setCamera720pFramerate(int framerate)
Set the framerate of the 720p camera video, which is stored in non-volatile HUD memory.
|
java.lang.Boolean |
setCameraCurrentResolution(ZebraHud.HudCameraResolution resolution)
Set the current camera resolution.
|
boolean |
setCameraZoom(int zoom)
Set the camera digital zoom value
|
void |
setDisplayOn(boolean on)
Set the HUD display on or off.
|
void |
setMicrophoneEnabled(boolean enable)
Set the the HUD microphone state.
|
void |
setScale(int percent)
Set the HUD display scale.
|
boolean |
showBitmapDirect(Bitmap bitmap)
Use the direct (fastest) method to show a bitmap on the HUD display.
|
void |
showCachedImage(byte[] bytes)
Show a byte array on the HUD display.
|
byte[] |
showHudView(View view)
Create a View to be drawn on the HUD display.
|
byte[] |
showHudViewBinding(ZebraHud.HudViewBinding hudViewBinding)
Create a View to be drawn on the HUD display.
|
byte[] |
showImage(Bitmap bitmap)
Show a bitmap on the HUD display.
|
byte[] |
showJim(java.lang.String jim)
Show a JSON image model on the HUD display.
|
byte[] |
showJim(java.lang.String jim,
byte[] jpegImage)
Show an existing background image (such as the returned image from
showHudView(View))
and apply a JSON image model to overlay the image. |
byte[] |
showJim(java.lang.String jim,
java.lang.String directoryImages,
java.lang.String imageFilename,
java.lang.String jimBase)
Show a JSON image model on the HUD display, with optional background image and Base JIM.
|
boolean |
showJpegDirect(byte[] jpeg)
Use the direct (fastest) method to show a jpeg on the HUD display.
|
byte[] |
showMessage(java.lang.String title,
java.lang.String message)
Show a message on the HUD display.
|
void |
startCameraCapture()
Start the HUD camera capturing images.
|
void |
startCameraCaptureRawJpeg()
Start the HUD camera capturing images, and returning them as raw jpeg frames
(from the motion-jpeg stream on the UVC camera).
|
void |
startImu(ZebraHud.ImuListener imuListener)
Start HUD IMU data streaming.
|
void |
stopCameraCapture()
Stop the HUD camera capturing images.
|
void |
stopImu()
Stop HUD IMU data streaming.
|
public static int BrightnessStepValue
public static int ScaleStepValue
public static int[] ListCamera720pFramerates
public void init(Application applicationContext)
Optionally call from Application.onCreate().
Recommended if your application uses many activities with the HUD.
applicationContext - The application context to be associated with the HUDpublic void deinit(Application applicationContext)
Optionally call from Application.onTerminate().
Recommended if your application uses many activities with the HUD.
applicationContext - The application context to be associated with the HUDpublic void attachToContext(Context context,
ZebraHud.EventListener listener)
context - Application context to be associated with the HUDlistener - Callback interfacepublic void detachFromContext(Context context,
java.lang.Boolean showInterrupt)
context - Application context to be associated with the HUDshowInterrupt - If true show "app interrupted" message on HUD, otherwise leave last imagepublic void onStart(Activity activity)
Call from Activity.onStart().
activity - The activity to be associated with the HUDpublic void onStop(Activity activity,
java.lang.Boolean showInterrupt)
Call from Activity.onStop().
This call will not clear the HUD display. Use clearDisplay() if this is desired.
activity - The activity to be associated with the HUDshowInterrupt - If true show "app interrupted" message on HUD, otherwise leave last imagepublic void onResume(Activity activity,
ZebraHud.EventListener listener)
Call from Activity.onResume().
activity - The activity to be associated with the HUDlistener - Callback interfacepublic void onPause(Activity activity)
Call from Activity.onPause().
activity - The activity to be associated with the HUDpublic java.lang.String getDeviceInfo()
The format of this information will be specific to the device.
public java.lang.String getServiceVersion()
public boolean isConnected()
public void setDisplayOn(boolean on)
on - True to set to on, false to set to offpublic boolean isDisplayOn()
public void clearDisplay()
public void setBrightness(int percent)
Note: do not call this API more than once per second. To ensure this, use the UI Button control (and not a Slider control) to adjust the brightness.
percent - The percentage brightness. The HUD display will set the nearest permitted value.public int getBrightness()
public void setScale(int percent)
percent - The percentage scale. The HUD display will set the nearest permitted valuepublic int getScale()
public byte[] showMessage(java.lang.String title,
java.lang.String message)
title - The title of the messagemessage - The body of the messagepublic byte[] showImage(Bitmap bitmap)
bitmap - The bitmap to showpublic byte[] showJim(java.lang.String jim)
jim - The JSON image modelpublic byte[] showJim(java.lang.String jim,
byte[] jpegImage)
showHudView(View))
and apply a JSON image model to overlay the image. This can be used to 'annotate' a previously generated image.jim - The JSON image modeljpegImage - Background jpeg image to usepublic byte[] showJim(java.lang.String jim,
java.lang.String directoryImages,
java.lang.String imageFilename,
java.lang.String jimBase)
jim - The JSON image modeldirectoryImages - Absolute directory path for all relative-path image filenamesimageFilename - (Optional) filename of the background image to use as defaultjimBase - (Optional) Base JIM to use, for global defaultspublic boolean showBitmapDirect(Bitmap bitmap)
setScale(int) functionality.
Note: the image will not appear in the HUD display, if it is not correctly sized to fit the display dimensions
(which is reported in getDeviceInfo())bitmap - The bitmap to showpublic boolean showJpegDirect(byte[] jpeg)
setScale(int) functionality.
Note: the image will not appear in the HUD display, if it is not correctly sized to fit the display dimensions
(which is reported in getDeviceInfo())jpeg - The jpeg to showpublic View createHudView(int layout)
To draw must call showHudView(View)
layout - The layout id to inflatepublic byte[] showHudView(View view)
View must be created with createHudView(int)
view - The view to draw to the HUD.public ZebraHud.HudViewBinding getHudViewBinding()
To draw must call showHudViewBinding(HudViewBinding)
public byte[] showHudViewBinding(ZebraHud.HudViewBinding hudViewBinding)
View must be created with getHudViewBinding() and the v3.6 View Binding feature.
hudViewBinding - The result from getHudViewBinding()public void showCachedImage(byte[] bytes)
Restore the HUD display using data received by ZebraHud.EventListener.onImageUpdated(byte[]).
bytes - The byte array to send to the displaypublic void setMicrophoneEnabled(boolean enable)
Warning: The HUD may disconnect and reconnect when changing the microphone state.
enable - True to enable, false to disablepublic boolean getMicrophoneEnabled()
public boolean getCameraEnabled()
public void startCameraCapture()
ZebraHud.EventListener.onCameraImage(Bitmap).public void startCameraCaptureRawJpeg()
ZebraHud.EventListener.onCameraImageRawJpeg(byte[]).public void stopCameraCapture()
public java.util.List<ZebraHud.HudCameraResolution> getCameraAllResolutions()
public ZebraHud.HudCameraResolution getCameraCurrentResolution()
public java.lang.Boolean setCameraCurrentResolution(ZebraHud.HudCameraResolution resolution)
resolution - Camera resolution to set, matching an entry from getCameraAllResolutions()public int getCameraZoom()
public boolean setCameraZoom(int zoom)
zoom - value from 0 to maxZoom from ZebraHud.HudCameraResolution.maxZoom,
for the current resolution from getCameraCurrentResolution()public int getCamera720pFramerate()
ListCamera720pFrameratespublic void setCamera720pFramerate(int framerate)
Note: Changing the framerate may require re-connecting the HUD to take effect.
framerate - framerate, matching one of ListCamera720pFramerates.
An invalid value may default the framerate to its factory setting.public boolean getImuStatus()
public void startImu(ZebraHud.ImuListener imuListener)
ZebraHud.ImuListener.onImuData(ImuData).imuListener - Callback interface for the IMU data listenerpublic void stopImu()