Extending your apps to wearables

Extending your apps to wearables

Learn how to take advantage from wearables? In this talk and learn how easily add support for Android Wear and Sony Smart Extension devices to your existing application. Besides that we'll talk about UI/UX on small screen, project structure best practices and finally decide what platform is more perspective and easier to work with from developer point of view.

F456ed67b75e58e533d11b301f5f62b5?s=128

Vitaliy Zasadnyy

September 06, 2014
Tweet

Transcript

  1. Extending your apps to wearables Vitalik Zasadnyy Ostap Andrusiv @zasadnyy

    @p1f IT Arena Lviv October 2-4
  2. None
  3. None
  4. None
  5. None
  6. Custom OS Android Wear ?

  7. Sony Smart Extensions Overview

  8. “Sony made wearables before it was mainstream...”

  9. Supported devices

  10. How the Smart Extension apps work

  11. Architecture

  12. Smart Extension APIs

  13. Compatibility

  14. Development

  15. Requirements • Eclipse / Android Studio • ADT • Sony

    Add-on SDK • Smart Connect • Host Application
  16. Project setup & structure • Use sample apps Official library

    Un-official library Actually project
  17. Hello IT Arena! • System.out.print(“Hello IT Arena!”) ? • AndroidManifest.xml

    ~ 40 lines, 10 intent filter actions 1 2 4 3
  18. Security <uses-permission android:name= ”com.sonyericsson.extras.liveware .aef.EXTENSION_PERMISSION” /> AndroidManifest.xml

  19. Using API Intent intent = new Intent(CONTROL_VIBRATE_INTENT); intent.putExtra(EXTRA_ON_DURATION, onDuration); intent.putExtra(EXTRA_OFF_DURATION,

    offDuration); sendToHostApp(intent); ScreenControll.java
  20. Bundle bundle1 = new Bundle(); bundle1.putInt(Control. Intents.EXTRA_LAYOUT_REFERENCE, R.id.exercise_name); bundle1.putString(Control.Intents.EXTRA_TEXT, name);

    Bundle bundle2 = new Bundle(); bundle2.putInt(Control. Intents.EXTRA_LAYOUT_REFERENCE, R.id.exercise_number); bundle2.putString(Control.Intents.EXTRA_TEXT, number); Bundle bundle3 = new Bundle(); bundle3.putInt(Control. Intents.EXTRA_LAYOUT_REFERENCE, R.id.exercise_timer); bundle3.putString(Control.Intents.EXTRA_TEXT, UiUtils. formatTimeLeft(timeLeft)); Bundle[] bundleData = new Bundle[5]; bundleData[0] = bundle1; bundleData[1] = bundle2; bundleData[2] = bundle3; showLayout(R.layout.exercise_screen, bundleData); Using API - HELL
  21. Debugging 1. Connect phone 2. Run 3. Debug Nothing special!

  22. Testing

  23. Emulator

  24. UI Guidelines

  25. No UI Guidelines!

  26. Things to consider • Resolution: 128x128 or 220x176 • Information

    levels • Dimmed mode design • Icon sizes, buttons …
  27. Publishing

  28. Publishing 1. Package as plain Android app 2. Upload to

    store 3. Add to description: “Smart Connect extension for SmartWatch 2”
  29. Android Wear SDK Overview

  30. Supported devices

  31. Zero Interaction Vision Automatic Fast Assistant

  32. Context Stream

  33. One Action, Big Gestures, Fast Interaction Design Principles

  34. Development

  35. Architecture Data Layer API in Play Services Bluetooth

  36. Wear Apps Android 4.4W Bluetooth Outer World somehow Awesome App

    Intents Play Store .apk wearable .apk Android Wear Play Services Data API Node API Message API wearable.apk
  37. Notifications work out of the box

  38. Notifications: Wearable Features Voice Input Stacking Pages

  39. Full-Screen Activities Wearable UI Library: • CircledImageView • WearableListView •

    CardFragment • ConfirmationActivity • GridViewPager • WatchViewStub
  40. Debugging • Direct connect ◦ use micro-usb cable and connect

    the device • Via Bluetooth ◦ enable debugging on phone & wearable ◦ enable Bluetooth debugging on wearable ◦ adb forward tcp:4444 localabstract:/adb-hub; adb connect localhost:4444
  41. Emulator

  42. UI Guidelines

  43. Remember Wear Design Principles: • One Action • Big Gestures

    • Fast Interaction
  44. Publishing

  45. App APK Wearable APK

  46. Packaging dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.google.android.gms:play-services:5.0.+@aar'

    compile 'com.android.support:support-v4:20.0.+'' wearApp project(':wear') } build.gradle
  47. Put it all together or “we need more wearable integrations...”

  48. Business case ?

  49. Architecture View Presenter Model IView, Activity, ScreenControl Common

  50. Project structure include ':smartExtensionAPI' include ':smartExtensionUtils' include ':visionTrainingLib' include ':visionTrainingWear'

    include ':visionTraining' settings.gradle
  51. Project structure

  52. Gradle config dependencies { compile project(':smartExtensionUtils') compile project(':visionTrainingLib') wearApp project(':visionTrainingWear')

    } build.gradle
  53. Eyes Exercises bit.ly/eyes-exercises

  54. The biggest Google related event in Ukraine

  55. Thanks for attention! Questions? Vitalik Zasadnyy Ostap Andrusiv @zasadnyy @p1f