- Print
- DarkLight
Using Vuzix HUD Resources and Action Menu
Vuzix has created libraries to give you a head start in designing your user experience. Adding these libraries to your Android project is simple and developer friendly. Vuzix provides a Jitpack repository for those libraries and other resources.
Adding HUD-Resources and HUD-ActionMenu to your Android Application
To be able to utilize the HUD-ActionMenu and HUD-Resources libraries, you will need to add a dependency in your application build.gradle file. These libraries are hosted in Jitpack. Detailed instructions for various build systems are available in JitPack for the hud-actionmenu and hud-resources, and summarized below for Groovy.
Your project-level gradle must specify the correct URL to search.
allprojects {
repositories {
google()
jcenter()
// The speech SDK is currently hosted by jitpack
maven { url "https://jitpack.io" }
}
}
In your app's build.gradle file just add the following line similar to the following to your dependencies section:
implementation 'com.vuzix:hud-actionmenu:2.10.0'
implementation 'com.vuzix:hud-resources:2.4.0'
The latest version of hud-actionmenu is
The latest version of hud-resources is
Your build.gradle for your application will look something like this:
apply plugin: 'com.android.application' android {
compileSdkVersion 35
defaultConfig {
applicationId "com.vuzix.m400.barcode_sample"
minSdkVersion 27
targetSdkVersion 35
versionCode 1
versionName "1.0"
}
}
dependencies {
implementation 'com.vuzix:hud-actionmenu:2.10.0'
}
Android Jetpack Compatibility
Beginning with version 2.0, the HUD-ActionMenu and HUD-Resources libraries support Android Jetpack. In addition, the HUD themes are based on Theme.AppCompat rather than Theme.Material. If you are not using Jetpack in your application, you should not upgrade past version 1.x of the HUD libraries. If you choose to migrate to Jetpack in the future, you must also upgrade to the latest HUB libraries at that time.
Utilizing the HUD Themes
With the HUD-Resource library in your project, you can now use the HUD theme as your main application theme. You also have access to a"light" variation of the HUD theme.
These themes will provide a good base for your application design and will also provide the color scheme as the default one for your layout.
To use the HUD theme as the main theme of the application, you just need to modify the Application Manifest and ensure the android:theme is "@style/HudTheme".
Your Android Manifest will look something like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vuzix.m400.barcode_sample">
<application android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:theme="@style/HudTheme">
<activity
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Utilizing HUD API Classes
The Vuzix HUD libraries include our customized versions of Activity classes and other frequently used classes.
The extension of those classes provides extra functionality and adds custom features to take full advantage of the Vuzix hardware platform.
We recommend that all your Activities extend the "ActionMenuActivity". Your Main Activity Class definition will look something like this:
public class MainActivity extends ActionMenuActivity { . . . }
Changing Action Menu Color
Beginning with version 1.5 of the HUD-ActionMenu library, you can easily change the color of the action menu. To do so, override actionMenuColor in your own theme:
<style name="AppTheme" parent="HudTheme">
<item name="actionMenuColor">@color/hud_red </item>
</style>
If you have two themes, for example light and dark mode themes, don't forget to define actionMenuColor in both themes.
If you want to customize the action menu beyond simple color changes, you will need to use custom views for the action menu items.
HUD Libraries Documentation
For more information and details check our Javadocs for the HUD Libraries:
For the HUD Resource Package: HUD-Resources Java Docs
For the HUD ActionMenu Package: HUD-ActionMenu Java Docs