Simulator setup
How to set up the simulator
1. Import and initialize the simulator package.
import com.htc.viveglass.sdk.simulator.ViveGlassSimulatorViveGlassSimulator.create(appContext)val simulator = ViveGlassSimulator.instance()
2. Set the ViveGlass adapter to the simulator object.
ViveGlass.adapter = simulator
3. Show the simulator UI.
simulator.showUI( supportFragmentManager )
4. Replace the simulator resources.
Important:
-
- Your app must be a debug version.
- Use Android Studio/Device Explorer to push files.
a. Replace the simulator image samples.
-
- Path: Transfer your file to the app files directory. (Ex. /data/data/com.htc.viveglass.viveglasssample/files/image_sample.heic)
- Specs: HEIC format, 1440×1920 resolution
b. Replace the simulator video samples.
-
- Path: Transfer your file to the app file directory. (Ex. /data/data/com.htc.viveglass.viveglasssample/files/video_sample.mp4)
- Specs: video (480×856, 30 FPS) with AAC audio (44.1 kHz, 32 kbps, Stereo)
c. Replace the simulator audio samples.
-
- Path: Transfer your file to the app files directory. (Ex. /data/data/com.htc.viveglass.viveglasssample/files/audio_sample.aac)
- Specs: AAC format, 44.1 kHz, 32 kbps, Stereo
You can refer to the following sample code files: MainActivity.kt and ViveGlassKitManager.kt.