I'm trying to make a photosphere viewer on Google Glass, something that should be not too difficult but is proving to be quite. I've run into several errors and was hoping someone could point me in the right direction. Thanks in advance!
I've tried using the Google Panorama API in order to embed a viewer on Glass as if it was an Android app. Understandably, this would require touch input to move the image on the viewer, but I thought I'd fix that issue as I got to it (which I never did). I ran into this issue of backwards compatibility - the API is mode, but Glass runs on Android 4.4 (before Material Design), so I kept getting errors with Material Design resources not found. (sorry I'm not very specific about this, I tried this method a while ago to no avail).
Since I had no success with the Panorama API, I decided to try implementing Google's Cardboard API instead, which already uses gyro motion to move the image, essentially the effect I want on Glass. Luckily, Google has put this under a few modules that do the hard work for you. I followed this sample code, simplepanowidget, to recreate the project on Glass. Unfortunately, I ran into the same problem as before. Following the sample code, one adds these dependencies to the project.
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':common')
compile project(':commonwidget')
compile project(':panowidget')
}
"commonwidget" and "panowidget" work fine, but "common" again results with this error:
Error:(3) Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.Material.Light.Dialog'.
As seen here, compiling these dependencies with the GDK results with an error where these resources aren't found. I tried also including support libraries, thinking that that would help with the backwards compatibility, but instead, libraries (such as Design) simply add more errors of resources not found. This leads me to believe that the libraries themselves don't work with the GDK? (I tried using the libraries on other regular android apps and they work fine)
Essentially, I've spent a long time working on several different methods only to run into the same compatibility issue problem. Some solutions I've thought of include:
- Overriding the theming of the "Common" module, essentially so that it doesn't need the material.light.dialog resource
- Finding a way to make the support libraries do what they're supposed to do
- Recreate the viewer from the "base" module of Google's vr/carboard API
Any suggestions for the above, or any other solution you can think of, would be much appreciated. Obviously the last one would be the most difficult, but if someone could link me to sample code (can't find much), that would be most useful.
Thanks!
