Introduction - NativeNov 24, 2016

Gallery sample application displays simple image exchange interactions between the host device and the Gear device using Accessory SDK. This sample application is a companion type and is provided in two following types.

Provider (Android) and Consumer (Gear)

Figure 1 Gallery - Provider (Android) and Consumer (Gear)
Figure 1 Gallery - Provider (Android) and Consumer (Gear)

This sample application has two parts:

  • GalleryProvider

    • Works in host device and has no UI.

    • Accepts a receiving service connection request from Gear device.

    • Replies to a receiving command to fetch image list from Gear device with list extracted from host application.

    • Replies to a receiving command to fetch images from Gear device with actual images after encoding it as BASE64.

  • GalleryConsumer

    • Works in Gear device and has UI.

    • Initiates service connection request and send commands to host device.

    • When receiving a response, decodes BASE64 encoded images and show it to user.

Provider (Gear) and Consumer (Android)

Figure 2 File Transfer - Sender (Gear) and Receiver (Android)
Figure 2 Gallery - Provider (Gear) and Consumer (Android)

This sample application has two parts:

  • GalleryProvider

    • Works in Gear device.

    • Accepts a receiving service connection request from host device.

    • Replies to a receiving command to fetch image list from host device with list extracted from Gear application.

    • Replies to a receiving command to fetch images from host device with actual images after encoding it as BASE64.

  • GalleryConsumer

    • Works in host device and has UI.

    • Initiates service connection request and send commands to Gear device.

    • When receiving a response, decodes BASE64 encoded images and shows it to user.