Transitioning from android to glass
Luis de la rosa
Lead App Developer
Capital One
Download latest slides and code at:
http://luisdelarosa.com/glass
Travis himes
Application Architect
MeetMe.com
Download code here:
https://github.com/thimes/GlassCardExamples
-or-
http://goo.gl/haQwgH
web -> phone
Bring over whole thing
Create subset of UI
Surface functionality via APIs (web services)
Design for smaller screen
Phone -> tablet
Scale it up
Utilize additional space better
phone -> glass
???
Profit
android
Glass
android vs glass: fight!
Display
Battery
Touch
Hello android world
Activity
TextView
Gdk setup
hello glass world
https://github.com/luisdelarosa/HelloGlass
Immersion
Voice Trigger
Theme
Glass Library
GDK vs android sdk
6 new packages
19 new classes
No emulator
Activities + Services play special roles
synergy
“The API surface of GDK Glassware is not limited to the classes contained in the GDK Add-on. The GDK Add-on merely closes the gaps between the Android SDK and features that are unique to Glass. This means, in general, given a problem that isn't covered by the GDK library directly, just attempt the Android solution.”
- Jenny Murphy
Staff Developer Programs Engineer on Google Glass
glanceable ui
Fundamentally different from phone and tablet UI
Less content
Quicker
Bigger
Now
timeline
Immersions exist outside
home card
Voice Launcher
Tap Launcher
Contrast with Home Screen
cards
Like Google Now
Horizontal rather than vertical
Main UI metaphor for Glass
use the templates
static cards
No longer in GDK as of XE 16
Use Mirror API
any questions so far?
'Slow' cards
Remote Views
Why "slow"?
PendingIntent
Code
REMOTE VIEWS
FrameLayout
LinearLayout
RelativeLayout
GridLayout
GridView
ImageView
ListView
ProgressView
StackView
TextView
AdapterViewFlipper
ViewFlipper
AnalogClock
Button
Chronometer
ImageButton
LinearLayout
RelativeLayout
GridLayout
ImageView
ListView
ProgressView
StackView
TextView
AdapterViewFlipper
ViewFlipper
Button
Chronometer
ImageButton
'Fast' cards
View Drawing
Update much quicker
Code
Menus
The same menus you're used to
Code
Questions?
immersions
Repurposed Activity
Full control over Glass hardware
Exist outside of Timeline
Be careful of Glassing-out
project: reddit viewer
List the posts in a subreddit
Common list-based app UI
android version
Activity
Vertical scrolling
Row-based
ListView
glass version
Immersion
Horizontal scrolling / paging of cards
CardScrollAdapter
CardScrollView
https://github.com/luisdelarosa/RedditViewerGlass
alternate android version
Horizontal scrolling / paging
Fragment-based
ViewPager
menus in immersions
Show when tapped
openOptionsMenu()
Ordinary Android menu methods
onCreateOptionsMenu()
onOptionsItemSelected()
onOptionsMenuClosed()
touch
Default: D-Pad events
Timeline consumes some for non-Immersions
Swipe down is like Back button
Two finger swipe down is sleep
more touch
GestureDetector
Swipe up/down/left/right + TwoSwipe
Tap / TwoTap / ThreeTap
LongPress / TwoLongPress / ThreeLongPress
Finger count change
Scroll listener
Two finger scroll listener
voice control
Voice Trigger
Voice Prompt
Speech Recognizer
No contextual voice commands yet (Issue http://code.google.com/p/google-glass-api/issues/detail?id=273)
head movement
Unique way to get user input
Not eye tracking
Accelerometer
Unknown ergonomic impact
Built-in Glass gestures
getWindow().addFlags(WindowUtils.FLAG_DISABLE_HEAD_GESTURES);
location
No Google Play Services yet
Old school Location
Iterate over all providers, including remote (tethered)
sensors
Accelerometer
Gyroscope
Magnetometer
Relative to "optics pod" aka prism
Light
camera
Capture image:
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(intent, MY_REQUEST_ID);
Capture video:
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
startActivityForResult(intent, MY_REQUEST_ID);
Can capture hardware button in Immersion
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_CAMERA) {
battery
Video
Sensors
navigation
Driving
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("google.navigation:q=your+address")); startActivity(intent);
Walking
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("google.navigation:q=your+address&mode=w")); startActivity(intent);
login flow
QR code
AccountManager
Star this issue: http://code.google.com/p/google-glass-api/issues/detail?id=276
In-Progress
open source libraries
glass-progress-bar
GlassSettings
glass-head-gesture-detector
extras
Alternative input methods
Text Recognition
BroadcastReceivers still exist
Poke Around!
next steps
https://developers.google.com/glass/community
https://github.com/googleglass
Tag [google-gdk] on Stack Overflow
File Bugs / Feature requests
Join local Glass meetups
Please give feedback via the app at
eventmobi.com/wearablesdevcon
any last questions?
Thanks!
Travis Himes
@travis_himes
Luis de la Rosa
@louielouie
Transitioning from android to glass 2.0
By Luis de la Rosa
Transitioning from android to glass 2.0
Co-presented with Travis Himes
- 2,174