$30 off During Our Annual Pro Sale. View Details »

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.

Vitaliy Zasadnyy

September 06, 2014
Tweet

More Decks by Vitaliy Zasadnyy

Other Decks in Programming

Transcript

  1. Extending your apps to
    wearables
    Vitalik Zasadnyy Ostap Andrusiv
    @zasadnyy @p1f
    IT Arena Lviv
    October 2-4

    View Slide

  2. View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. Custom OS Android Wear
    ?

    View Slide

  7. Sony Smart Extensions
    Overview

    View Slide

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

    View Slide

  9. Supported devices

    View Slide

  10. How the Smart Extension apps work

    View Slide

  11. Architecture

    View Slide

  12. Smart Extension APIs

    View Slide

  13. Compatibility

    View Slide

  14. Development

    View Slide

  15. Requirements
    ● Eclipse / Android Studio
    ● ADT
    ● Sony Add-on SDK
    ● Smart Connect
    ● Host Application

    View Slide

  16. Project setup & structure
    ● Use sample apps
    Official library
    Un-official library
    Actually project

    View Slide

  17. Hello IT Arena!
    ● System.out.print(“Hello IT Arena!”) ?
    ● AndroidManifest.xml ~ 40 lines, 10 intent filter actions
    1
    2
    4
    3

    View Slide

  18. Security
    ”com.sonyericsson.extras.liveware
    .aef.EXTENSION_PERMISSION” />
    AndroidManifest.xml

    View Slide

  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

    View Slide

  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

    View Slide

  21. Debugging
    1. Connect phone
    2. Run
    3. Debug
    Nothing special!

    View Slide

  22. Testing

    View Slide

  23. Emulator

    View Slide

  24. UI Guidelines

    View Slide

  25. No UI Guidelines!

    View Slide

  26. Things to consider
    ● Resolution: 128x128 or 220x176
    ● Information levels
    ● Dimmed mode design
    ● Icon sizes, buttons …

    View Slide

  27. Publishing

    View Slide

  28. Publishing
    1. Package as plain Android app
    2. Upload to store
    3. Add to description:
    “Smart Connect extension for SmartWatch 2”

    View Slide

  29. Android Wear SDK
    Overview

    View Slide

  30. Supported devices

    View Slide

  31. Zero Interaction
    Vision
    Automatic Fast
    Assistant

    View Slide

  32. Context Stream

    View Slide

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

    View Slide

  34. Development

    View Slide

  35. Architecture
    Data Layer API in Play Services
    Bluetooth

    View Slide

  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

    View Slide

  37. Notifications
    work out of the box

    View Slide

  38. Notifications: Wearable Features
    Voice Input Stacking
    Pages

    View Slide

  39. Full-Screen Activities
    Wearable UI Library:
    ● CircledImageView
    ● WearableListView
    ● CardFragment
    ● ConfirmationActivity
    ● GridViewPager
    ● WatchViewStub

    View Slide

  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

    View Slide

  41. Emulator

    View Slide

  42. UI Guidelines

    View Slide

  43. Remember Wear
    Design Principles:
    ● One Action
    ● Big Gestures
    ● Fast Interaction

    View Slide

  44. Publishing

    View Slide

  45. App APK
    Wearable APK

    View Slide

  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

    View Slide

  47. Put it all together
    or “we need more wearable integrations...”

    View Slide

  48. Business case
    ?

    View Slide

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

    View Slide

  50. Project structure
    include ':smartExtensionAPI'
    include ':smartExtensionUtils'
    include ':visionTrainingLib'
    include ':visionTrainingWear'
    include ':visionTraining'
    settings.gradle

    View Slide

  51. Project structure

    View Slide

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

    View Slide

  53. Eyes Exercises
    bit.ly/eyes-exercises

    View Slide

  54. The biggest Google related event in Ukraine

    View Slide

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

    View Slide