This repository provides a bare-bones example of how to build a Third-Party App (TPA) for AugmentOS, the operating system for smart glasses. If you want to get started with building apps for AugmentOS, start here.
If you just want to dive in:
- Clone this repo.
- Install AugmentOSLib
- Build and deploy the app to your AugmentOS Puck or other device running AugmentOS Core.
You're now running an AugmentOS TPA!
If you want to start from scratch:
- Start a fresh Android Studio Project.
- Install AugmentOSLib
- Add the following to your app's
AndroidManifest.xml
file:
<service android:name="com.yourpackage.YourAugmentosService"
android:exported="true">
<!-- Intent filter required to communicate with AugmentOS -->
<intent-filter>
<action android:name="AUGMENTOS_INTENT" />
</intent-filter>
</service>
- Create a
tpa_config.json
file inapp/src/main/res/raw/
:
{
"name": "Example App",
"description": "Example App Description",
"version": "1.0.0",
"settings": [
{
"key": "enableLogging",
"type": "toggle",
"label": "Enable Logging",
"defaultValue": true
},
{
"key": "username",
"type": "text",
"label": "Username",
"defaultValue": "JohnDoe"
},
{
"key": "volumeLevel",
"type": "slider",
"label": "Volume Level",
"min": 0,
"max": 100,
"defaultValue": 50
}
]
}
- Build and deploy the app to your AugmentOS Puck or other device running AugmentOS Core.
You're now running an AugmentOS TPA!
-
Clone the AugmentOS repository next to your app's directory (default setup)
-
If you cloned the AugmentOS repository elsewhere, update the path to AugmentOSLib in
settings.gradle
:project(':AugmentOSLib').projectDir = new File(rootProject.projectDir, '../AugmentOS/augmentos_android_library/AugmentOSLib')
- The core of this app is a foreground service (
ExampleAugmentosAppService
) that extendsSmartGlassesAndroidService
. - This service allows the app to:
- Communicate with the AugmentOS Core.
- Subscribe to data streams like transcription and phone notifications
- Display content directly on the smart glasses.
The library interacts with AugmentOS in a few ways:
- Data Subscriptions
- Display Requests
- Access & Modify AugmentOS Settings
The app can subscribe to a variety of data streams and handle the incoming events:
// Request English transcriptions
augmentOSLib.requestTranscription("English");
// Get them like this
@Subscribe
public void onSpeechTranscriptionTranscript(SpeechRecOutputEvent event) {}
// Request translated English transcriptions from Spanish
augmentOSLib.requestTranslation("Spanish", "English");
// Get them like this
@Subscribe
public void onSpeechTranslationTranscript(TranslateOutputEvent event) {}
// Request phone notifications
augmentOSLib.requestNotifications();
// Get them like this
@Subscribe
public void onNotificationEvent(NotificationEvent event) {}
(COMING SOON)
// Request glasses button taps
augmentOSLib.requestGlassesSideTaps();
// Get them like this
@Subscribe
public void onGlassesSideEvent(GlassesSideTapEvent event) {}
(COMING SOON)
// Request smart ring button taps
augmentOSLib.requestSmartRingButtonTaps();
// Get them like this
@Subscribe
public void onSmartRingButtonTapEvent(SmartRingButtonTapEvent event) {}
Reference cards:
augmentOSLib.sendReferenceCard("Title", "Body text.");
Bullet point lists:
augmentOSLib.sendBulletPointList("Title", new String[] {"Point 1", "Point 2"});
Centered text:
augmentOSLib.sendCenteredText("Centered Text Example");
Text wall:
augmentOSLib.sendTextWall("This is a block of text that fills the screen.");
Double text wall
augmentOSLib.sendDoubleTextWall("Top Text", "Bottom Text");
Row cards:
augmentOSLib.sendRowsCard(new String[] {"Row 1", "Row 2", "Row 3"});
(COMING SOON) Bitmap images:
augmentOSLib.sendBitmap(myBitmap);
(COMING SOON) Custom layouts via JSON:
augmentOSLib.sendCustomContent("{ \"custom\": \"layout\" }");
To start, specify a settings object in your tpa_config.json
{
"name": "Example App",
"description": "An example app for AugmentOS",
"version": "1.0.0",
"settings": [
{
"key": "exampleToggleSetting",
"type": "toggle",
"label": "This is a toggle",
"defaultValue": true
},
{
"key": "exampleTextSetting",
"type": "text",
"label": "This is a text box",
"defaultValue": "Some good default here"
},
{
"key": "exampleSliderSetting",
"type": "slider",
"label": "This is a slider",
"min": 0,
"max": 100,
"defaultValue": 50
},
{
"key": "selectInfoText",
"type": "titleValue",
"label": "This is a select dropdown",
"value": "Use this to have users select one of a few options"
},
{
"key": "exampleSelectSetting",
"type": "select",
"label": "Color Scheme",
"options": [
{ "label": "Light", "value": "light" },
{ "label": "Dark", "value": "dark" },
{ "label": "System", "value": "system" }
],
"defaultValue": "system"
},
{
"key": "selectInfoText",
"type": "titleValue",
"label": "This is a multiselect",
"value": "Use this to have users select one or more of a few options"
},
{
"key": "exampleMultiselectSetting",
"type": "multiselect",
"label": "Favorite Colors",
"options": [
{ "label": "Red", "value": "red" },
{ "label": "Green", "value": "green" },
{ "label": "Blue", "value": "blue" },
{ "label": "Yellow", "value": "yellow" }
],
"defaultValue": ["red", "blue"]
}
]
}
Access settings within your app
AugmentOSSettingsManager.getBooleanSetting(this, "exampleToggleSetting");
AugmentOSSettingsManager.getStringSetting(this, "exampleTextSetting");
AugmentOSSettingsManager.getSliderSetting(this, "exampleSliderSetting");
AugmentOSSettingsManager.getSelectSetting(this, "exampleSelectSetting");
AugmentOSSettingsManager.getMultiSelectSetting(this, "exampleMultiselectSetting");
Modify settings within your app
AugmentOSSettingsManager.setBooleanSetting(this, "exampleToggleSetting", true);
AugmentOSSettingsManager.setStringSetting(this, "exampleTextSetting", "New value!");
AugmentOSSettingsManager.setSliderSetting(this, "exampleSliderSetting", 42);
AugmentOSSettingsManager.setSelectSetting(this, "exampleSelectSetting", "Dark");
AugmentOSSettingsManager.setMultiSelectSetting(this, "test", Arrays.asList("Blue", "Red"));
This project is licensed under the MIT License. See the LICENSE
file for more details.