Setting up the development environment¶
Applications targeting Iristick smart glasses run on a standard Android smartphone, and are thus developed like normal mobile applications. For more information, see the Android Developers site.
Note
Because the applications targeting Iristick smart glasses run on the smartphone, the Glass templates should not be used to set up an Android Studio project.
Adding Iristick libraries to an Android Studio Project¶
To make use of all the features of Iristick smart glasses through the API described further in this documentation, the Iristick libraries must be added to the dependencies of the project.
First, the Iristick repository should be added to the project's root
build.gradle
file. The allprojects
section should look like this:
allprojects {
repositories {
google()
jcenter()
ivy { url 'https://developer.iristick.com/repo' }
}
}
Alternatively, you can download and extract the SDK ZIP package.
The libs
folder contains the libraries structured as an Ivy repository.
To use the extracted folder, the allprojects
section should look like:
allprojects {
repositories {
google()
jcenter()
ivy { url 'file:///path/to/sdk/libs' }
}
}
The Iristick core library can then be added as a dependency to the
build.gradle
file of the app module:
dependencies {
implementation 'com.iristick.smartglass:core:1.3.4'
implementation 'com.iristick.smartglass:support:1.3.4'
}
Debugging on a phone connected to Iristick smart glasses¶
Debugging an application targeting Iristick smart glasses cannot be done by connecting the smartphone to the developer computer through USB, as the USB port is already used by the smart glasses connection. Instead, the Android Debug Bridge (ADB) can be used over Wifi.
Connect the smartphone to be debugged to the developer computer with a USB cable and enable network access by running
adb -d tcpip 5555
Disconnect the smartphone from the developer computer and run
(replace 192.168.0.10
with the IP address of the smartphone):
adb connect 192.168.0.10:5555
ADB can now be used as usual, including debugging with Android Studio.
Mirroring the content of the display¶
The content of the headset display can be mirrored on the desktop. To do so, open the Iristick Services settings and check Web console under Developer settings. Next, on a desktop browser in the same network as the smartphone, browse to the URL given on the settings screen.
Note
The developer console is only accessible when a headset is connected.