This page will help you to get started right away with developing applications for the SmartEyeglass device. It will guide you through installation of the SmartEyeglass SDK, and setting up your development and test environments.
It is expected that you are already familiar with the Android SDK, and have installed the Android Studio. For more information about obtaining this software and setting up the environment, see the official Android developer website.
- A. Installation
To start developing apps for SmartEyeglass, you’ll need to install the SmartEyeglass SDK. The following instruction requires you to have the Android SDK and Android Studio installed on your computer (you may also be using other developer tools).
There are two ways to install the SmartEyeglass SDK:
- Install through Android SDK Manager
- Install manually
When you have finished installing the SmartEyeglass SDK, you can set up your IDE to begin developing your SmartEyeglass app.
- Open Your IDE and start the Android SDK Manager.
- In the Android SDK Manager, choose Tools > Manage Add-on Sites.
- Select the User Defined Sites tab and click New.
- Enter this URL in the Add Add-on Site URL dialog.
- Click OK. The Android SDK Manager downloads the SmartEyeglass SDK from the Sony server.
- Click Close and confirm that you want to sort the listed SDKs by API level.
- Expand the display of available SDKs available under Android 4.4.2 (API 19), select the checkbox for the SmartEyeglass SDK, then click Install 1 package. This initiates the installation of the SmartEyeglass SDK.
If you’re not using the Android SDK Manager, you can still download and install the SmartEyeglass SDK manually. Simply download the SmartEyeglass SDK manual installation zip file to your computer, and unzip to a location of your choice. The download location you choose is referred to in the documentation as SDK_root.
If you choose to install manually, make sure that you have a supported version of the Android API (level 16 or higher) installed.
SmartEyeglass SDK contents
The SmartEyeglass SDK extends the Android SDK with the functionality needed to control and work with the SmartEyeglass device, using the Smart Extension software framework. It includes a host application (HostApp) that runs on an Android phone and communicates with the SmartEyeglass device. The latest version of the required SmartConnect app, which allows the components to communicate with the OS and with one another, can be downloaded from Google Play.
The SmartEyeglass SDK includes libraries that define the base classes and Android Intents and Content Providers that form the basis for your device-control apps, and also a set of sample apps that demonstrate how to access and control the specific features of the SmartEyeglass device. To create new applications for the device, you will modify and extend the included samples.
The SmartEyeglass SDK has this folder structure:
SDK_root/docs/reference/ The complete API reference for the SmartEyeglass libraries. SDK_root/samples/ Android Studio projects for the API libraries that define the base classes and for the samples that demonstrate functionality SDK_root/apks/ Compiled Android Application Packages (APK files). SDK_root/apks/SmartEyeglassEmulator.apk Package for the emulator to be installed on the host device for testing. SDK_root/apks/samples/* Packages for the samples that demonstrate functionality.
- B. Set up your development environment
It is very easy to set up your development environment with the SmartEyeglass sample project built for Android Studio. You can directly open an existing project.
Please note: Make sure you have Android API 17 onwards installed on your Android SDK Manager.
Set up a workspace in Android Studio
- From the Quick Start, choose Open an existing Android Studio project.
- Browse to the
SDK_root/samples/folder (the exact location depends on where you installed the SmartEyeglass SDK).
- Select the directory of 1 sample projects you want to open and click OK
When import is complete, your workspace should include selected sample project you have opened.
- From the Quick Start, choose Open an existing Android Studio project.
- C. Prepare a test environment
You can test a compiled application package (APK) on the SmartEyeglass emulator that is included in the SmartEyeglass SDK. The emulator is an application that runs on any Android phone. You can, of course, also test directly on the SmartEyeglass device, if available.
Prepare the phone
Before you start your tests, you must download the SmartConnect and SmartEyeglass (the HostApp) apps from Google Play and install them on the Android device.
- The HostApp component handles communication between the Android device and the SmartEyeglass device or emulator.
- The SmartConnect component coordinates Sony accessory devices and the applications that have been extended to support them. (This is the new name for software formerly known as Liveware.)
Your individual SmartEyeglass application is associated with the SmartEyeglass-specific HostApp application installed on the Android device. It can also communicate with other hosts using the APIs for other Sony accessories.
- Download the the latest versions of the SmartConnect and SmartEyeglass HostApp components to your host Android device from Google Play.
- Install the Emulator app package on your Android device using the adb utility. In a command shell, change to the
/apks/folder and run this command:
adb install SmartEyeglassEmulator.apk
- Install the app package for the application you want to test on your prepared Android device. To get started, you can use one of the samples. For example:
adb install HelloSensors.apk
Run the app on the emulator
The SmartEyeglass emulator is an Android app that you installed on your Android phone. When you run this app, you see a green UI that looks like what you would see on the SmartEyeglass device. A grey area on the lower-right part of the screen acts as the controller track pad; you can swipe and tap here to navigate through the cards. Swipe left-to-right on this track-pad area to scroll through the installed apps. Find your app and select it with a tap.
Prepare the SmartEyeglass device and run the app
If you are testing your application on the SmartEyeglass device itself, you must pair and connect it with your prepared Android phone, as described in the instructions that are included with your device.
When the device is paired and connected, the app that you installed on the Android device appears on the device as a card in the main menu. Swipe left-to-right on the controller’s track pad to find your app, and select it with a tap.
- D. Design and develop your app
After you have imported the required library sources and sample extension applications, you are ready to get started. The library project and dependencies are already setup among these imported projects as shown here:
Importing these Android projects into your workspace automatically assigns them the closest Android build target available. Both the minimum supported Android API level and the target API level should be set to revision 19. When the workspace has been built successfully, you will see that your imported sample project has been compiled into an Android Application Package (an APK file). You can use this to test your development environment.
Design and develop your app
The sample projects are already set up to include all required classes, and each one defines basic functionality for access to and control of a particular feature of the device. You can modify and extend any of the sample projects to create your own application functionality.
After you’ve set up the SmartEyeglass SDK and prepared your development and test environment, you can begin developing your own apps.
- API overview: Explains the required and optional components of a SmartEyeglass app project, and gives an overview of the software and hardware architecture.
- How to create your first SmartEyeglass project: This tutorial provides a hands-on example that shows how to begin modifying and extending one of the provided samples to begin developing your own functionality.
- Design guidelines: Provides important app-design recommendations that will help you get a start on creating an application that takes advantage of the device features and that can be used safely.
- Guides overview: A set of guides to the unique features of the SmartEyeglass device.