├── .gitignore ├── .idea ├── .gitignore ├── .name ├── compiler.xml ├── deploymentTargetDropDown.xml ├── deploymentTargetSelector.xml ├── gradle.xml ├── migrations.xml ├── misc.xml ├── runConfigurations.xml └── vcs.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── .idea │ ├── .gitignore │ ├── gradle.xml │ ├── misc.xml │ └── vcs.xml ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── augmentos │ │ └── example_augmentos_app │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── ic_launcher-playstore.png │ ├── java │ │ └── com │ │ │ └── augmentos │ │ │ └── example_augmentos_app │ │ │ ├── ExampleAugmentosAppService.java │ │ │ └── LauncherActivity.java │ └── res │ │ ├── drawable │ │ ├── ic_launcher_background.xml │ │ └── ic_launcher_foreground.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── navigation │ │ └── nav_graph.xml │ │ ├── raw │ │ └── tpa_config.json │ │ ├── values-land │ │ └── dimens.xml │ │ ├── values-night │ │ └── themes.xml │ │ ├── values-w1240dp │ │ └── dimens.xml │ │ ├── values-w600dp │ │ └── dimens.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── ic_launcher_background.xml │ │ ├── strings.xml │ │ └── themes.xml │ │ └── xml │ │ ├── backup_rules.xml │ │ └── data_extraction_rules.xml │ └── test │ └── java │ └── com │ └── augmentos │ └── example_augmentos_app │ └── ExampleUnitTest.java ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | local.properties 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Log/OS Files 24 | *.log 25 | 26 | # Android Studio generated files and folders 27 | captures/ 28 | .externalNativeBuild/ 29 | .cxx/ 30 | *.apk 31 | output.json 32 | 33 | # IntelliJ 34 | *.iml 35 | .idea/ 36 | misc.xml 37 | deploymentTargetDropDown.xml 38 | render.experimental.xml 39 | 40 | # Keystore files 41 | *.jks 42 | *.keystore 43 | 44 | # Google Services (e.g. APIs or Firebase) 45 | google-services.json 46 | 47 | # Android Profiling 48 | *.hprof 49 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | ExampleAugmentosApp -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/deploymentTargetDropDown.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/deploymentTargetSelector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 20 | 21 | -------------------------------------------------------------------------------- /.idea/migrations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 17 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 TeamOpenSmartGlasses 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Example AugmentOS App 2 | 3 | ### Update 2025 - this repo is outdated. To build an [AugmentOS](https://augmentos.org/) app for smart glasses such as *Even Realities G1* and *Vuzix Z100*, check out the new [AugmentOS Example Cloud App Repository](https://github.com/AugmentOS-Community/AugmentOS-Cloud-Example-App). 4 | 5 | 6 | 7 | 8 | 9 | 10 | # Example AugmentOS App (OUTDATED) 11 | 12 | This repository provides a **bare-bones example** of how to build a Third-Party App (TPA) for **[AugmentOS](https://www.augmentos.org/)**, the operating system for smart glasses. If you want to get started with building apps for AugmentOS, start here. 13 | 14 | --- 15 | 16 | # How to make an AugmentOS app 17 | 18 | ## **Super Easy Mode: Clone This Repo** 19 | 20 | If you just want to dive in: 21 | 1. Clone this repo. 22 | 2. [Install AugmentOSLib](#augmentoslib-installation) 23 | 3. Build and deploy the app to your AugmentOS Puck or other device running AugmentOS Core. 24 | 25 | You're now running an AugmentOS TPA! 26 | 27 | --- 28 | 29 | ## **Easy Mode: Start from Scratch** 30 | 31 | If you want to start from scratch: 32 | 1. Start a fresh Android Studio Project. 33 | 2. [Install AugmentOSLib](#augmentoslib-installation) 34 | 3. Add the following to your app's `AndroidManifest.xml` file: 35 | 36 | ``` 37 | 39 | 40 | 41 | 42 | 43 | 44 | ``` 45 | 46 | 4. Create a `tpa_config.json` file in `app/src/main/res/raw/`: 47 | 48 | ```json 49 | { 50 | "name": "Example App", 51 | "description": "Example App Description", 52 | "version": "1.0.0", 53 | "settings": [ 54 | { 55 | "key": "enableLogging", 56 | "type": "toggle", 57 | "label": "Enable Logging", 58 | "defaultValue": true 59 | }, 60 | { 61 | "key": "username", 62 | "type": "text", 63 | "label": "Username", 64 | "defaultValue": "JohnDoe" 65 | }, 66 | { 67 | "key": "volumeLevel", 68 | "type": "slider", 69 | "label": "Volume Level", 70 | "min": 0, 71 | "max": 100, 72 | "defaultValue": 50 73 | } 74 | ] 75 | } 76 | ``` 77 | 78 | 5. Build and deploy the app to your AugmentOS Puck or other device running AugmentOS Core. 79 | 80 | You're now running an AugmentOS TPA! 81 | 82 | --- 83 | 84 | ## **AugmentOSLib installation** 85 | 86 | 1. Clone the [AugmentOS repository](https://github.com/AugmentOS-Community/AugmentOS) next to your app's directory (default setup) 87 | 88 | 2. If you cloned the [AugmentOS repository](https://github.com/AugmentOS-Community/AugmentOS) elsewhere, update the path to AugmentOSLib in `settings.gradle`: 89 | ``` 90 | project(':AugmentOSLib').projectDir = new File(rootProject.projectDir, '../AugmentOS/augmentos_android_library/AugmentOSLib') 91 | ``` 92 | 93 | --- 94 | 95 | ## **How It Works** 96 | 97 | ### **Service-Based Architecture** 98 | - The core of this app is a foreground service (`ExampleAugmentosAppService`) that extends `SmartGlassesAndroidService`. 99 | - This service allows the app to: 100 | - Communicate with the AugmentOS Core. 101 | - Subscribe to data streams like transcription and phone notifications 102 | - Display content directly on the smart glasses. 103 | 104 | ## **AugmentOSLib** 105 | 106 | The library interacts with AugmentOS in a few ways: 107 | - Data Subscriptions 108 | - Display Requests 109 | - Access & Modify AugmentOS Settings 110 | 111 | --- 112 | 113 | ### **Data Subscriptions** 114 | 115 | The app can subscribe to a variety of data streams and handle the incoming events: 116 | 117 | ```java 118 | // Request English transcriptions 119 | augmentOSLib.requestTranscription("English"); 120 | 121 | // Get them like this 122 | @Subscribe 123 | public void onSpeechTranscriptionTranscript(SpeechRecOutputEvent event) {} 124 | ``` 125 | 126 | ```java 127 | // Request translated English transcriptions from Spanish 128 | augmentOSLib.requestTranslation("Spanish", "English"); 129 | 130 | // Get them like this 131 | @Subscribe 132 | public void onSpeechTranslationTranscript(TranslateOutputEvent event) {} 133 | ``` 134 | 135 | ```java 136 | // Request phone notifications 137 | augmentOSLib.requestNotifications(); 138 | 139 | // Get them like this 140 | @Subscribe 141 | public void onNotificationEvent(NotificationEvent event) {} 142 | ``` 143 | 144 | (COMING SOON) 145 | ```java 146 | // Request glasses button taps 147 | augmentOSLib.requestGlassesSideTaps(); 148 | 149 | // Get them like this 150 | @Subscribe 151 | public void onGlassesSideEvent(GlassesSideTapEvent event) {} 152 | ``` 153 | 154 | (COMING SOON) 155 | ```java 156 | // Request smart ring button taps 157 | augmentOSLib.requestSmartRingButtonTaps(); 158 | 159 | // Get them like this 160 | @Subscribe 161 | public void onSmartRingButtonTapEvent(SmartRingButtonTapEvent event) {} 162 | ``` 163 | --- 164 | 165 | ### Displaying content on smart glasses 166 | 167 | **Reference cards**: 168 | ```java 169 | augmentOSLib.sendReferenceCard("Title", "Body text."); 170 | ``` 171 | **Bullet point lists**: 172 | ```java 173 | augmentOSLib.sendBulletPointList("Title", new String[] {"Point 1", "Point 2"}); 174 | ``` 175 | **Centered text**: 176 | ```java 177 | augmentOSLib.sendCenteredText("Centered Text Example"); 178 | ``` 179 | **Text wall**: 180 | ```java 181 | augmentOSLib.sendTextWall("This is a block of text that fills the screen."); 182 | ``` 183 | **Double text wall** 184 | ```java 185 | augmentOSLib.sendDoubleTextWall("Top Text", "Bottom Text"); 186 | ``` 187 | **Row cards**: 188 | ```java 189 | augmentOSLib.sendRowsCard(new String[] {"Row 1", "Row 2", "Row 3"}); 190 | ``` 191 | **(COMING SOON) Bitmap images**: 192 | ```java 193 | augmentOSLib.sendBitmap(myBitmap); 194 | ``` 195 | **(COMING SOON) Custom layouts via JSON**: 196 | ```java 197 | augmentOSLib.sendCustomContent("{ \"custom\": \"layout\" }"); 198 | ``` 199 | 200 | --- 201 | 202 | ### Access & Modify AugmentOS Settings 203 | 204 | **To start, specify a settings object in your `tpa_config.json`** 205 | 206 | ``` 207 | { 208 | "name": "Example App", 209 | "description": "An example app for AugmentOS", 210 | "version": "1.0.0", 211 | "settings": [ 212 | { 213 | "key": "exampleToggleSetting", 214 | "type": "toggle", 215 | "label": "This is a toggle", 216 | "defaultValue": true 217 | }, 218 | { 219 | "key": "exampleTextSetting", 220 | "type": "text", 221 | "label": "This is a text box", 222 | "defaultValue": "Some good default here" 223 | }, 224 | { 225 | "key": "exampleSliderSetting", 226 | "type": "slider", 227 | "label": "This is a slider", 228 | "min": 0, 229 | "max": 100, 230 | "defaultValue": 50 231 | }, 232 | { 233 | "key": "selectInfoText", 234 | "type": "titleValue", 235 | "label": "This is a select dropdown", 236 | "value": "Use this to have users select one of a few options" 237 | }, 238 | { 239 | "key": "exampleSelectSetting", 240 | "type": "select", 241 | "label": "Color Scheme", 242 | "options": [ 243 | { "label": "Light", "value": "light" }, 244 | { "label": "Dark", "value": "dark" }, 245 | { "label": "System", "value": "system" } 246 | ], 247 | "defaultValue": "system" 248 | }, 249 | { 250 | "key": "selectInfoText", 251 | "type": "titleValue", 252 | "label": "This is a multiselect", 253 | "value": "Use this to have users select one or more of a few options" 254 | }, 255 | { 256 | "key": "exampleMultiselectSetting", 257 | "type": "multiselect", 258 | "label": "Favorite Colors", 259 | "options": [ 260 | { "label": "Red", "value": "red" }, 261 | { "label": "Green", "value": "green" }, 262 | { "label": "Blue", "value": "blue" }, 263 | { "label": "Yellow", "value": "yellow" } 264 | ], 265 | "defaultValue": ["red", "blue"] 266 | } 267 | ] 268 | } 269 | ``` 270 | 271 | **Access settings within your app** 272 | ```java 273 | AugmentOSSettingsManager.getBooleanSetting(this, "exampleToggleSetting"); 274 | 275 | AugmentOSSettingsManager.getStringSetting(this, "exampleTextSetting"); 276 | 277 | AugmentOSSettingsManager.getSliderSetting(this, "exampleSliderSetting"); 278 | 279 | AugmentOSSettingsManager.getSelectSetting(this, "exampleSelectSetting"); 280 | 281 | AugmentOSSettingsManager.getMultiSelectSetting(this, "exampleMultiselectSetting"); 282 | ``` 283 | 284 | **Modify settings within your app** 285 | ```java 286 | AugmentOSSettingsManager.setBooleanSetting(this, "exampleToggleSetting", true); 287 | 288 | AugmentOSSettingsManager.setStringSetting(this, "exampleTextSetting", "New value!"); 289 | 290 | AugmentOSSettingsManager.setSliderSetting(this, "exampleSliderSetting", 42); 291 | 292 | AugmentOSSettingsManager.setSelectSetting(this, "exampleSelectSetting", "Dark"); 293 | 294 | AugmentOSSettingsManager.setMultiSelectSetting(this, "test", Arrays.asList("Blue", "Red")); 295 | ``` 296 | --- 297 | 298 | ## **License** 299 | 300 | This project is licensed under the MIT License. See the `LICENSE` file for more details. 301 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /app/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | -------------------------------------------------------------------------------- /app/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | -------------------------------------------------------------------------------- /app/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /app/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | } 4 | 5 | android { 6 | namespace 'com.augmentos.example_augmentos_app' 7 | compileSdk 33 8 | 9 | defaultConfig { 10 | applicationId "com.augmentos.example_augmentos_app" 11 | minSdk 30 12 | targetSdk 33 13 | versionCode 1 14 | versionName "1.0" 15 | 16 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 23 | } 24 | } 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_1_8 27 | targetCompatibility JavaVersion.VERSION_1_8 28 | } 29 | buildFeatures { 30 | viewBinding true 31 | } 32 | } 33 | 34 | dependencies { 35 | implementation 'androidx.appcompat:appcompat:1.6.1' 36 | testImplementation 'junit:junit:4.13.2' 37 | androidTestImplementation 'androidx.test.ext:junit:1.1.5' 38 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' 39 | implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' 40 | 41 | implementation project(path: ':AugmentOSLib') 42 | 43 | implementation("org.greenrobot:eventbus:3.3.1") 44 | 45 | implementation 'io.reactivex.rxjava3:rxandroid:3.0.2' 46 | implementation 'io.reactivex.rxjava3:rxjava:3.1.5'} -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /app/src/androidTest/java/com/augmentos/example_augmentos_app/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.augmentos.example_augmentos_app; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.test.platform.app.InstrumentationRegistry; 6 | import androidx.test.ext.junit.runners.AndroidJUnit4; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | 11 | import static org.junit.Assert.*; 12 | 13 | /** 14 | * Instrumented test, which will execute on an Android device. 15 | * 16 | * @see Testing documentation 17 | */ 18 | @RunWith(AndroidJUnit4.class) 19 | public class ExampleInstrumentedTest { 20 | @Test 21 | public void useAppContext() { 22 | // Context of the app under test. 23 | Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); 24 | assertEquals("com.augmentos.example_augmentos_app", appContext.getPackageName()); 25 | } 26 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/ic_launcher-playstore.png -------------------------------------------------------------------------------- /app/src/main/java/com/augmentos/example_augmentos_app/ExampleAugmentosAppService.java: -------------------------------------------------------------------------------- 1 | package com.augmentos.example_augmentos_app; 2 | 3 | import android.util.Log; 4 | 5 | import com.augmentos.augmentoslib.AugmentOSCommand; 6 | import com.augmentos.augmentoslib.AugmentOSSettingsManager; 7 | import com.augmentos.augmentoslib.PhoneNotification; 8 | import com.augmentos.augmentoslib.SmartGlassesAndroidService; 9 | import com.augmentos.augmentoslib.DataStreamType; 10 | import com.augmentos.augmentoslib.FocusStates; 11 | import com.augmentos.augmentoslib.AugmentOSLib; 12 | import com.augmentos.augmentoslib.SpeechRecUtils; 13 | import com.augmentos.augmentoslib.events.NotificationEvent; 14 | import com.augmentos.augmentoslib.events.SpeechRecOutputEvent; 15 | import com.augmentos.augmentoslib.events.StartAsrStreamRequestEvent; 16 | import com.augmentos.augmentoslib.events.StopAsrStreamRequestEvent; 17 | import com.augmentos.augmentoslib.events.TranslateOutputEvent; 18 | 19 | import org.greenrobot.eventbus.Subscribe; 20 | 21 | import java.util.Arrays; 22 | import java.util.List; 23 | 24 | public class ExampleAugmentosAppService extends SmartGlassesAndroidService { 25 | public final String TAG = "ExampleService"; 26 | 27 | // Our instance of the AugmentOS library 28 | public AugmentOSLib augmentOSLib; 29 | 30 | public ExampleAugmentosAppService() { 31 | super(); 32 | } 33 | 34 | @Override 35 | public void onCreate() { 36 | super.onCreate(); 37 | } 38 | 39 | public void setup(){ 40 | // Create AugmentOSLib instance 41 | augmentOSLib = new AugmentOSLib(this); 42 | 43 | // To start receiving speech transcriptions, request a speech transcription stream 44 | augmentOSLib.requestTranscription("English"); 45 | 46 | // To start receiving speech translations, request a speech translation stream. 47 | // augmentOSLib.requestTranslation("Spanish", "English"); 48 | 49 | // To start receiving phone notifications, request a phone notification stream 50 | // TODO: This isn't necessary currently 51 | // TODO: For now, just subscribe to notifications without requesting 52 | // augmentOSLib.requestNotifications(); 53 | 54 | // To access your AugmentOS settings, you can do the following: 55 | boolean exampleToggleSetting = AugmentOSSettingsManager.getBooleanSetting(this, "exampleToggleSetting"); 56 | String exampleTextSetting = AugmentOSSettingsManager.getStringSetting(this, "exampleTextSetting"); 57 | Integer exampleSliderSetting = AugmentOSSettingsManager.getSliderSetting(this, "exampleSliderSetting"); 58 | String exampleSelectSetting = AugmentOSSettingsManager.getSelectSetting(this, "exampleSelectSetting"); 59 | List exampleMultiselectSetting = AugmentOSSettingsManager.getMultiSelectSetting(this, "exampleMultiselectSetting"); 60 | } 61 | 62 | // To get speech transcription, subscribe to them using EventBus 63 | @Subscribe 64 | public void onSpeechTranscriptionTranscript(SpeechRecOutputEvent event) { 65 | String text = event.text; 66 | String languageCode = event.languageCode; 67 | long time = event.timestamp; 68 | boolean isFinal = event.isFinal; 69 | 70 | String title = "Got a " + languageCode + " transcript:"; 71 | 72 | if (isFinal) { 73 | augmentOSLib.sendReferenceCard(title, text); 74 | } 75 | } 76 | 77 | // To get speech translation, subscribe to them using EventBus 78 | // @Subscribe 79 | // public void onSpeechTranslationTranscript(TranslateOutputEvent event) { 80 | // String text = event.text; 81 | // String fromLanguageCode = event.fromLanguageCode; 82 | // String toLanaguageCode = event.toLanguageCode; 83 | // Long timestamp = event.timestamp; 84 | // boolean isFinal = event.isFinal; 85 | // 86 | // String formattedMessage = "Got a translation from " + fromLanguageCode + " to " + toLanaguageCode + ": " + text; 87 | // 88 | // if (isFinal) { 89 | // augmentOSLib.sendTextWall(formattedMessage); 90 | // } 91 | // } 92 | 93 | // To get phone notifications, subscribe to them with EventBus 94 | @Subscribe 95 | public void onNotificationEvent(NotificationEvent event) { 96 | Log.d(TAG, "Received event: " + event + ", " + event.text); 97 | String formattedNotification = event.title + ": " + event.text; 98 | augmentOSLib.sendReferenceCard("You've got mail!", formattedNotification); 99 | } 100 | 101 | @Override 102 | public void onDestroy() { 103 | // deInit your augmentOSLib instance onDestroy 104 | augmentOSLib.deinit(); 105 | super.onDestroy(); 106 | } 107 | 108 | } 109 | -------------------------------------------------------------------------------- /app/src/main/java/com/augmentos/example_augmentos_app/LauncherActivity.java: -------------------------------------------------------------------------------- 1 | package com.augmentos.example_augmentos_app; 2 | 3 | import android.content.ActivityNotFoundException; 4 | import android.content.ComponentName; 5 | import android.content.Intent; 6 | import android.net.Uri; 7 | import android.os.Bundle; 8 | import android.util.Log; 9 | import android.widget.Toast; 10 | 11 | import androidx.appcompat.app.AppCompatActivity; 12 | 13 | public class LauncherActivity extends AppCompatActivity { 14 | 15 | private static final String TAG = "LauncherActivity"; 16 | private static final String TARGET_PACKAGE = "com.augmentos.augmentos"; 17 | private static final String DEEP_LINK_SCHEME = "augmentos"; 18 | private static final String DEEP_LINK_HOST = "open"; 19 | private static final String FALLBACK_URL = "https://augmentos.org"; 20 | 21 | @Override 22 | protected void onCreate(Bundle savedInstanceState) { 23 | super.onCreate(savedInstanceState); 24 | Log.d(TAG, "LauncherActivity started"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 13 | 15 | 17 | 19 | 21 | 23 | 25 | 27 | 29 | 31 | 33 | 35 | 37 | 39 | 41 | 43 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | 69 | 71 | 73 | 75 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 8 | 12 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/navigation/nav_graph.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/raw/tpa_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Example App", 3 | "description": "An example app for AugmentOS", 4 | "version": "1.0.0", 5 | "settings": [ 6 | { 7 | "type": "group", 8 | "title": "This is a settings page example" 9 | }, 10 | { 11 | "key": "infoText", 12 | "type": "titleValue", 13 | "label": "Here's a title for some info text", 14 | "value": "Here's a body for some info text" 15 | }, 16 | { 17 | "type": "group", 18 | "title": "Here are some possible settings you can use" 19 | }, 20 | { 21 | "key": "exampleToggleSetting", 22 | "type": "toggle", 23 | "label": "This is a toggle", 24 | "defaultValue": true 25 | }, 26 | { 27 | "key": "exampleTextSetting", 28 | "type": "text", 29 | "label": "This is a text box", 30 | "defaultValue": "Some good default here" 31 | }, 32 | { 33 | "key": "exampleSliderSetting", 34 | "type": "slider", 35 | "label": "This is a slider", 36 | "min": 0, 37 | "max": 100, 38 | "defaultValue": 50 39 | }, 40 | { 41 | "key": "selectInfoText", 42 | "type": "titleValue", 43 | "label": "This is a select dropdown", 44 | "value": "Use this to have users select one of a few options" 45 | }, 46 | { 47 | "key": "exampleSelectSetting", 48 | "type": "select", 49 | "label": "Color Scheme", 50 | "options": [ 51 | { "label": "Light", "value": "light" }, 52 | { "label": "Dark", "value": "dark" }, 53 | { "label": "System", "value": "system" } 54 | ], 55 | "defaultValue": "system" 56 | }, 57 | { 58 | "key": "multiselectInfoText", 59 | "type": "titleValue", 60 | "label": "This is a multiselect", 61 | "value": "Use this to have users select one or more of a few options" 62 | }, 63 | { 64 | "key": "exampleMultiselectSetting", 65 | "type": "multiselect", 66 | "label": "Favorite Colors", 67 | "options": [ 68 | { "label": "Red", "value": "red" }, 69 | { "label": "Green", "value": "green" }, 70 | { "label": "Blue", "value": "blue" }, 71 | { "label": "Yellow", "value": "yellow" } 72 | ], 73 | "defaultValue": ["red", "blue"] 74 | }, 75 | { 76 | "type": "group", 77 | "title": "For more information, check out docs.augmentos.org" 78 | } 79 | ] 80 | } 81 | -------------------------------------------------------------------------------- /app/src/main/res/values-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 48dp 3 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 12 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/values-w1240dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 200dp 3 | -------------------------------------------------------------------------------- /app/src/main/res/values-w600dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 48dp 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFBB86FC 4 | #FF6200EE 5 | #FF3700B3 6 | #FF03DAC5 7 | #FF018786 8 | #FF000000 9 | #FFFFFFFF 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #D0D0D0 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AugmentOS Example App 3 | -------------------------------------------------------------------------------- /app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 12 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | -------------------------------------------------------------------------------- /app/src/test/java/com/augmentos/example_augmentos_app/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.augmentos.example_augmentos_app; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | plugins { 3 | id 'com.android.application' version '8.0.0' apply false 4 | id 'com.android.library' version '8.0.0' apply false 5 | } -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Enables namespacing of each library's R class so that its R class includes only the 19 | # resources declared in the library itself and none from the library's dependencies, 20 | # thereby reducing the size of the R class for that library 21 | android.nonTransitiveRClass=true 22 | android.defaults.buildfeatures.buildconfig=true 23 | android.nonFinalResIds=false -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AugmentOS-Community/AugmentOS-Example-App/fc531b3244bb6d5fb4c987bb7641c6cb86dc4add/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip 4 | networkTimeout=10000 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | # This is normally unused 84 | # shellcheck disable=SC2034 85 | APP_BASE_NAME=${0##*/} 86 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 87 | 88 | # Use the maximum available, or set MAX_FD != -1 to use that value. 89 | MAX_FD=maximum 90 | 91 | warn () { 92 | echo "$*" 93 | } >&2 94 | 95 | die () { 96 | echo 97 | echo "$*" 98 | echo 99 | exit 1 100 | } >&2 101 | 102 | # OS specific support (must be 'true' or 'false'). 103 | cygwin=false 104 | msys=false 105 | darwin=false 106 | nonstop=false 107 | case "$( uname )" in #( 108 | CYGWIN* ) cygwin=true ;; #( 109 | Darwin* ) darwin=true ;; #( 110 | MSYS* | MINGW* ) msys=true ;; #( 111 | NONSTOP* ) nonstop=true ;; 112 | esac 113 | 114 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 115 | 116 | 117 | # Determine the Java command to use to start the JVM. 118 | if [ -n "$JAVA_HOME" ] ; then 119 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 120 | # IBM's JDK on AIX uses strange locations for the executables 121 | JAVACMD=$JAVA_HOME/jre/sh/java 122 | else 123 | JAVACMD=$JAVA_HOME/bin/java 124 | fi 125 | if [ ! -x "$JAVACMD" ] ; then 126 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 127 | 128 | Please set the JAVA_HOME variable in your environment to match the 129 | location of your Java installation." 130 | fi 131 | else 132 | JAVACMD=java 133 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 134 | 135 | Please set the JAVA_HOME variable in your environment to match the 136 | location of your Java installation." 137 | fi 138 | 139 | # Increase the maximum file descriptors if we can. 140 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 141 | case $MAX_FD in #( 142 | max*) 143 | # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. 144 | # shellcheck disable=SC3045 145 | MAX_FD=$( ulimit -H -n ) || 146 | warn "Could not query maximum file descriptor limit" 147 | esac 148 | case $MAX_FD in #( 149 | '' | soft) :;; #( 150 | *) 151 | # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. 152 | # shellcheck disable=SC3045 153 | ulimit -n "$MAX_FD" || 154 | warn "Could not set maximum file descriptor limit to $MAX_FD" 155 | esac 156 | fi 157 | 158 | # Collect all arguments for the java command, stacking in reverse order: 159 | # * args from the command line 160 | # * the main class name 161 | # * -classpath 162 | # * -D...appname settings 163 | # * --module-path (only if needed) 164 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 165 | 166 | # For Cygwin or MSYS, switch paths to Windows format before running java 167 | if "$cygwin" || "$msys" ; then 168 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 169 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 170 | 171 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 172 | 173 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 174 | for arg do 175 | if 176 | case $arg in #( 177 | -*) false ;; # don't mess with options #( 178 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 179 | [ -e "$t" ] ;; #( 180 | *) false ;; 181 | esac 182 | then 183 | arg=$( cygpath --path --ignore --mixed "$arg" ) 184 | fi 185 | # Roll the args list around exactly as many times as the number of 186 | # args, so each arg winds up back in the position where it started, but 187 | # possibly modified. 188 | # 189 | # NB: a `for` loop captures its iteration list before it begins, so 190 | # changing the positional parameters here affects neither the number of 191 | # iterations, nor the values presented in `arg`. 192 | shift # remove old arg 193 | set -- "$@" "$arg" # push replacement arg 194 | done 195 | fi 196 | 197 | 198 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 199 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 200 | 201 | # Collect all arguments for the java command; 202 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 203 | # shell script including quotes and variable substitutions, so put them in 204 | # double quotes to make sure that they get re-expanded; and 205 | # * put everything else in single quotes, so that it's not re-expanded. 206 | 207 | set -- \ 208 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 209 | -classpath "$CLASSPATH" \ 210 | org.gradle.wrapper.GradleWrapperMain \ 211 | "$@" 212 | 213 | # Stop when "xargs" is not available. 214 | if ! command -v xargs >/dev/null 2>&1 215 | then 216 | die "xargs is not available" 217 | fi 218 | 219 | # Use "xargs" to parse quoted args. 220 | # 221 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 222 | # 223 | # In Bash we could simply go: 224 | # 225 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 226 | # set -- "${ARGS[@]}" "$@" 227 | # 228 | # but POSIX shell has neither arrays nor command substitution, so instead we 229 | # post-process each arg (as a line of input to sed) to backslash-escape any 230 | # character that might be a shell metacharacter, then use eval to reverse 231 | # that process (while maintaining the separation between arguments), and wrap 232 | # the whole thing up as a single "set" statement. 233 | # 234 | # This will of course break if any of these variables contains a newline or 235 | # an unmatched quote. 236 | # 237 | 238 | eval "set -- $( 239 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 240 | xargs -n1 | 241 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 242 | tr '\n' ' ' 243 | )" '"$@"' 244 | 245 | exec "$JAVACMD" "$@" 246 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%"=="" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%"=="" set DIRNAME=. 29 | @rem This is normally unused 30 | set APP_BASE_NAME=%~n0 31 | set APP_HOME=%DIRNAME% 32 | 33 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 34 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 35 | 36 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 37 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 38 | 39 | @rem Find java.exe 40 | if defined JAVA_HOME goto findJavaFromJavaHome 41 | 42 | set JAVA_EXE=java.exe 43 | %JAVA_EXE% -version >NUL 2>&1 44 | if %ERRORLEVEL% equ 0 goto execute 45 | 46 | echo. 47 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 48 | echo. 49 | echo Please set the JAVA_HOME variable in your environment to match the 50 | echo location of your Java installation. 51 | 52 | goto fail 53 | 54 | :findJavaFromJavaHome 55 | set JAVA_HOME=%JAVA_HOME:"=% 56 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 57 | 58 | if exist "%JAVA_EXE%" goto execute 59 | 60 | echo. 61 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 62 | echo. 63 | echo Please set the JAVA_HOME variable in your environment to match the 64 | echo location of your Java installation. 65 | 66 | goto fail 67 | 68 | :execute 69 | @rem Setup the command line 70 | 71 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 72 | 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if %ERRORLEVEL% equ 0 goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | set EXIT_CODE=%ERRORLEVEL% 85 | if %EXIT_CODE% equ 0 set EXIT_CODE=1 86 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% 87 | exit /b %EXIT_CODE% 88 | 89 | :mainEnd 90 | if "%OS%"=="Windows_NT" endlocal 91 | 92 | :omega 93 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | gradlePluginPortal() 6 | } 7 | } 8 | dependencyResolutionManagement { 9 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | } 15 | rootProject.name = "ExampleAugmentosApp" 16 | include ':app' 17 | 18 | include ':AugmentOSLib' 19 | project(':AugmentOSLib').projectDir = new File(rootProject.projectDir, '../AugmentOS/augmentos_android_library/AugmentOSLib') --------------------------------------------------------------------------------