-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage on Glass #19
Comments
This is awesome, is there any way to develop for glass without actually owning it? |
Awesome indeed! This makes me want to apply for a new Glass keyword like "read to me" :). I've included updated layouts for small screen sizes in ee4ac86. Let me know if it fixes the layout issues pictured! As for file choosing, I don't include any sort of file chooser, instead opting for the system to handle a ACTION_GET_CONTENT or ACTION_OPEN_DOCUMENT (Android 4.4's built-in file chooser) Intent. It makes sense that Glass doesn't have a pre-installed file explorer, but installing one should remedy that issue. Also, Google, if you're out there, you should ditch that old TI chipset and update Glass to 4.4 already :) RE: Any specific advice regarding tab navigation? The top three Action Bar buttons should work. I can add some linkage to ensure swiping from the Spritz TextView places you right on the Chapter button, but can't think of any other tab navigation I'd add. |
@andrewgiang you should be able to download the GDK Sneak Peek (https://developers.google.com/glass/develop/gdk/) but I don't believe that the emulator will work. |
@OnlyInAmerica Google has announced that they are working on updating Glass to 4.4. Regarding the tab navigation...I had to add an onKeyDown implementation in MainActivity to capture the tap event as KEYCODE_DPAD_CENTER to display the options menu (which comes up as a series of cards...so the icons are not necessary on Glass). However, this interferes with tap events that the SpritzFragment expects the TextView to handle. (you'll have to excuse my Android ignorance, I'm rather inexperienced with it; my expertise is with iOS). |
@rcarlsen Would you mind posting the code snippets that you used to get that far? I've been hacking away at this but I'm a web guy, not an Android guy and not even an iOS guy, haha. But would love to get this even just "sort-of" working on Glass and would love to do what I can to help. |
Sure, I'll get my fork up on github sometime today.
|
Here is my working branch. It ain't pretty: |
@OnlyInAmerica layout is looking better, thank you. |
@rcarlsen cool cool that's a huge help. i ended up taking your code and restoring the original epub selector and installing a generic file browser (http://www.lysesoft.com/products/andexplorer/) and it "works" wonderfully. one thing: i had to uninstall the google music file browser first (adb uninstall com.google.android.music) because right now the "choose an app" screen is broken on glass. hope I won't be needing that package for anything else... |
@brettneese ...and your fork with these changes? :) |
Would be cool if we could continually work on a dev branch for google glass on here together instead of on a bunch of separate forks :p |
@rcarlsen: yep yep, was going to work on that today. though it's literally just @OnlyInAmerica's SpritzFragment.java with your MainActivity.java. i also want to see if i can natively hack in a file browser for Glass, there seem to be a couple (https://code.google.com/p/filebrowser-android/), so we don't have to go through this dance. @andrewgiang: +1, but we'll get there methinks. |
@brettneese hey I think this library https://github.com/iPaulPro/aFileChooser would be good for your problem. |
are you compiling/loading this onto Glass via ADT or using Gradle and side-loading the APK? I've attempted to import it into ADT but wind up chasing weird issues starting with: "invalid resource directory name ic_launcher.png". When I compile it with Gradle and side-load the APK, the app crashes almost immediately. |
Could you send a stack trace? I'd be happy to try resolving the crash.
|
I've been using Android Studio (which uses Gradle). It is then installing the apk via adb, I believe. (note, my branch has a hard-coded reference to an epub file that is not included in the resources directory. see comment in the readme: rcarlsen@87592cd) |
Alright. I've spent a day getting up and running on Android Studio. If you don't mind, could you humor a n00b and tell me if my process sounds correct?
Am I even close? The app no longer crashes glass on load, but only after opening/closing a handful of times does the app respond to any gestures. When I can get a response and I select the book icon, the app crashes ("Openspritz has stopped"). I'm guessing this is due to the file not loading. OnlyInAmerica, I see you forked a build for Glass/small screens--should I build this through the gradle shell commands as you describe in the readme or can I do this in AS/ADT? I really appreciate any and all help. |
Building with Android Studio: First If you're not actually modifying the code you can of course install the pre-built APK I try to update with each commit. If you could capture the crash in Android Studio's device log (or by typing Also, because OpenSpritz relies on third party file choosers at the moment, you need to place your epub in a public location like the FYI: The small screens layout change is a commit. This repository is mine, anyone who'd like to copy it is "forking" to create their own "fork" of this repository, complete with every commit I've authored. :) |
Thanks a million! |
I've attempted to side load your compiled apk on Glass (b7c2127) and I'm back to seeing it crash on open. I'm attempting to attach a txt with the last blocks of output from the logcat. If it doesn't come through, I'll try to pm it to you. |
@khyrtous Could you retry that with the current APK and pastebin / email me the trace [email protected]. I unfortunately had ProGuarded the apk you installed, which obscures some data from that log. |
FWIW, I've updated my fork to this repo's current master HEAD and disabled the hardcoded epub loading. It is working fine with Andexplorer on my Glass. I haven't made a pull request because these changes are focused on making the app usable on Glass with limited consideration about regular handsets (specifically, use dark theme by default, hide the action bar / status bar, map KEYCODE_DPAD_CENTER to openOptionsMenu() and {Shift + } KEYCODE_TAB to play pause. https://github.com/rcarlsen/OpenSpritz-Android/tree/feature/glass-modifications |
rcarlsen, I finished a working build with gestures implemented (seemingly) properly. back to stop, forward to start, fling back to go to previous chapter, fling forward for next chapter, should be uploading tonight, if my glass ever finishes updating to 4.4 (which hopefully will fix the chooser issue we saw on this thread earlier) |
Yeah, update to 4.4 hosed a lot of stuff. Back to the drawing board. |
It would be nice if the UI were compatible with the Glass interface. I believe that the Glass touchscreen swipes are passed as Tab / Shift-tab. Would it be difficult to enable tab cycling among the UI controls?
FWIW, the stock build instructions made an apk which successfully runs on my Glass (XE12).
The text was updated successfully, but these errors were encountered: