Save 10% off ANY FITC event with discount code 'slideshare'
See our upcoming events at www.fitc.ca
OVERVIEW
There are about 10,000 Google Glass devices in the wild, but only a fraction of those are in the hands of developers. Mike DiGiovanni, creator of Glass apps like Launchy, Winky, and Bulletproof, will guide you through what it takes to create a native Glass app, style it to look Glassy, and get it running on a plain old Android emulator/hardware. You will learn the some of the APIs that work best on Glass, along with a list of APIs to avoid. If the GDK remains unavailable by the time of the presentation, there will be a section on future proofing your software.
Mike will be available afterwards to give attendees the opportunity to experience Glass and get some 1-on-1 Q&A time. This is a presentation aimed at beginners to native Glass development. Some Android development experience is a plus.
6. Glassless
A sample app
Plain old Android SDK
Basic sensor usage – Google sample
Basic interaction usage - Google sample
Basic TTS
Example of maps static API and location – Jenny
Murphy of Google
Examples of menu
Examples of theming
8. Menus
XE7 - Google made a change to the underlying
platform to present menus in a very Glassy way
Pulls from HDPI bucket
Mostly white, subtle shading, hard to describe
70x70 icons
10. Touch management – Stop Watch
Touchpad on the side
Translate to keystrokes
tab, dpad left – swipe backward
shift+tab, dpad right – swipe forward
back – swipe down
dpad center - tap
Generic Motion Events
11. Sensors - Compass
Not the greatest
Typical
registration
Typical events
12. More sensors - Level
Can be used to balance it
on your head straight
Gaming functions
Typical registration
Typical events
13. Location – Sugar Glider
Short confusing history
NOW Standard location
provider registration
and listening
Need maps?
14. Audio Recording – Wave form
Mono
AudioSource mic
AudioRecord
class
15. What APIs don’t work
Location API
Voice Recognition
Face detection
Google APIs (Maps, +, Play Store)
16. Final conversion
Remove any usage of non hdpi bitmap based
drawables
Likely that a menu will automatically show up and we
wont have to do a dance
Evaluate Battery life
Final GDK
18. Tips
Screen off = App exit
Don’t go out of your way
Evaluate whether it’s really worth going native
Think inside a timeline
Make friends in the community
XE10
Limit text, limit depth, limit functionality
How can my company's software for Glass change our
customers lives?
How can Glass hardware change my company?
19. Ideas
Second screen for gaming – HUD, Hidden info
Pro camera
Viewfinder for wifi cameras
Presentation helper
Think business specific
Assistive devices
20. Resources
Mike dg Google+ http://goo.gl/CmC9SH
@evilmikedg
Mike dg github http://www.github.com/kaze0
Mirror API https://developers.google.com/glass/about
GDK https://developers.google.com/glass/gdk
Glass Development G+ Community http://goo.gl/ctgLT0
Jenny Murphy - Google Developer
https://github.com/mimming/sugarglider
General sensors -
http://developer.android.com/guide/topics/sensors/sensors
_overview.html
Notes de l'éditeur
10,000 Google Glass devices in the wildCan’t officially get Glass outside of the US eitherTips to make something that you can test on a phone an emulator and eventually run on Glass with minimal changes.What APIs to avoid, what to play withStyle glassyRun on an emulator, phone, and eventually Glass
First developers to start playing with native app Dev in glass. Native dev means low latency access to location, sensors, camera.Most famous: WinkyThanks to theGoogler’sfor nailing that sensorI’d love to see a more granular api thoughMost recent: GTA GPS
This was the live demonstration slide. For post-presentation purposes look at http://www.youtube.com/watch?v=v1uyQZNg2vE
No option of accessing other sensors with mirror apiMirror apican really control the user experience, but if you wind up stepping away from that you can start to controltheexperience. Create somethign that doesnt use a timeline. This lends itself better to complete custom software like if we dpeloyed this to a businessOn Mirror API, all data must go through Google.HIPPA in the states, creates a big pain for any healthcare software.
Known working Android development environment.You can create and deploy to emulator.Good understanding of Android development. You may run into issues if you plan to deploy this before you get the hardware, understanding or working through issues on devices you don’t have is a huge pain.
Sample app that shows off a few key points and then pulls in some of the recent samples from the Google folks.Just showing some sensors that workThe sensors and sugarglider/location are adapted from googlesamples https://developers.google.com/glass/gdkJenny Murphy did sugar glider https://github.com/mimming/sugarglider
No android device with screen characteristics similar to Glass.Your best shot at handling this is creating an emulator AVD device.Of course the problem develops that sensor support isn’t great, but you can treat this emulator as your UI tester, and fall back to whatever device to test sensorsHDPI screen, it puls from those bucketssand resolution is about 640x360DisplayMetrics{density=1.5, width=640, height=360, scaledDensity=1.5, xdpi=180.62222, ydpi=169.33333}Screen Size: 3" Resolution: 640x360 RAM: 682 MB Size: Small Screen Ratio: notlong Density: hdpiTarget 4.0.3 with everything, Glass is really 4.0.4 but that’s just bug fixes, no API changes
The main interaction pattern on Glass is the timeline. Basically a list of cards for you toPretty much identical to how you create an Android app menuAndroid doesn’t really use icons anymore, but Glass will.
Glass runs on Android. Old versions of Glass made it so that you sometimes see the standard android notification bar through normal usage. Deploy a custom native app, youll see this for sure, this solves that problem.You’ll want to black everything out, force landscape, kill the title, make it fullscreenTurn the action bar off.
Two methods of touchpad interaction: giving generic motion events and by giving keystrokesI tend to use dpad controls along with the real stuff so we can control it in a real device or on an emulator intuitivelyYou receive generic motion events. Map x,y can pass to a gestureDetector, I do that for bulletproof https://github.com/kaze0/bulletproof @Overridepublic booleanonGenericMotionEvent(MotionEvent event) {gestureDetector.onTouchEvent(event);return true; }Can apply a touch listener and get content back from across the side of the device, map that to something to be able to translateHow ot handle these? GenericMotionEvents can be replaced with touch events, not quite perfect but close enoughIf you have a device w/ a dpad or the emulator, that works nicely as wellCheck meta state for shift
Like phones this can be pretty wonkyCan’t do figure 8’s with your head to “fix” thisIt certainly has it’s uses and can sometimes be really goodSensors list10-02 19:01:01.094: D/Glassless(17478): MPL Gyroscope10-02 19:01:03.422: D/Glassless(17478): MPL Accelerometer10-02 19:01:04.337: D/Glassless(17478): MPL Magnetic Field10-02 19:01:08.493: D/Glassless(17478): MPL Orientation10-02 19:01:08.493: D/Glassless(17478): MPL Rotation Vector10-02 19:01:08.493: D/Glassless(17478): MPL Linear Acceleration10-02 19:01:08.493: D/Glassless(17478): MPL Gravity10-02 19:01:08.501: D/Glassless(17478): LTR-506ALS Light sensor10-02 19:01:08.501: D/Glassless(17478): Rotation Vector Sensor10-02 19:01:08.501: D/Glassless(17478): Gravity Sensor10-02 19:01:08.501: D/Glassless(17478): Linear Acceleration Sensor10-02 19:01:08.501: D/Glassless(17478): Orientation Sensor10-02 19:01:08.501: D/Glassless(17478): Corrected Gyroscope Sensor
You can use the acclerometer gyro to do whatever you needUse it for games for leveling photos as you take them.This is just a fun little use caseSensors list10-02 19:01:01.094: D/Glassless(17478): MPL Gyroscope10-02 19:01:03.422: D/Glassless(17478): MPL Accelerometer10-02 19:01:04.337: D/Glassless(17478): MPL Magnetic Field10-02 19:01:08.493: D/Glassless(17478): MPL Orientation10-02 19:01:08.493: D/Glassless(17478): MPL Rotation Vector10-02 19:01:08.493: D/Glassless(17478): MPL Linear Acceleration10-02 19:01:08.493: D/Glassless(17478): MPL Gravity10-02 19:01:08.501: D/Glassless(17478): LTR-506ALS Light sensor10-02 19:01:08.501: D/Glassless(17478): Rotation Vector Sensor10-02 19:01:08.501: D/Glassless(17478): Gravity Sensor10-02 19:01:08.501: D/Glassless(17478): Linear Acceleration Sensor10-02 19:01:08.501: D/Glassless(17478): Orientation Sensor10-02 19:01:08.501: D/Glassless(17478): Corrected Gyroscope Sensor
No location providers at firstIt was getting the data over the TCP connection and creating a custom service to consume thatUndocumented and annoyingAt some point they fixed thatNo Google APIs so no Google Maps officially. You can use static maps APIs. Nothing feels Glassy right now. I hope they will provide a way of showing maps.Typically registration. In the sample we have here, we can show a static map
Locaiton API was recently addedVoice recognition currently does not work.I expect we will get access to the standard API in the future, after all they nailed it with the location APIFace detection probably aligns with them trying to address privacy concerns, upload to g+ and google will pick out the faces for a user to manually tagThe Google APIs don’t work, think of this as a more generic Android device
Glass has a much smaller battery than on your phone 570 mah hour, that’s less a quarter of most modern phones. Respect the batteryYou can leave a bit of the navigation and other touch code inBattery life is going to be the most important thing, if runningyourapp takes off a half hour of typical usage, I’m probably going to ditch your app very quicklyHang in there for official GDK. Things will likely get more polishedlike life cycle, I mentioned the menu
Live demo
Don’t try to break around the screen off ignoring the app exit. I’ve done some attempts and it breaks a lot of functionality in GlassIt’s likely something that we will get APIs forLikewise, the menu system needs some trickery sometimes to show up. Don’t bother trying to fix it. This is a normal navigation pattern we will likely get better APIsI know I didn’t mention too much about the Mirror API here. I’ll be honest it just doesn’t’ interest me that much. But I implore you to look at it and see if your app fits that better.If it doesn’t, take a look at how you might change your app to fit into that model.I think native apps will have an uphill battle due to battery life and user experience. But it’s the area where the most exciting things can happen.You might be able to score invites. Not everyone has 3 friends who want to pay $1500 for Glass. If another batch of invites come out you might be able to get oneLimit your app. Glass auth is a great example of something not to do, UX wise. IT was brought over quickly. And is just reordered for landscape mode.