SlideShare a Scribd company logo
1 of 46
Download to read offline
Android Wear
Douglas Drumond
douglas@roboto.ninja
Background
Coding
Not Coding
Notifications
Notifications
Notifications
Notifications
Nada a ser feito
Enhanced notifications
Enhanced notifications
Nada a ser feito
Coding
Ação só p/ relógio
// Create an intent for the reply action
Intent actionIntent = new Intent(this, ActionActivity.class);
PendingIntent actionPendingIntent =
        PendingIntent.getActivity(this, 0, actionIntent,
                PendingIntent.FLAG_UPDATE_CURRENT);
// Create the action
NotificationCompat.Action action =
        new NotificationCompat.Action.Builder(R.drawable.ic_action,
                getString(R.string.label), actionPendingIntent)
                .build();
// Build the notification and add the action via WearableExtender
Notification notification =
        new NotificationCompat.Builder(mContext)
                .setSmallIcon(R.drawable.ic_message)
                .setContentTitle(getString(R.string.title))
                .setContentText(getString(R.string.content))
                .extend(new WearableExtender().addAction(action))
                .build();
Voz
// Key for the string that's delivered in the action's intent
private static final String EXTRA_VOICE_REPLY = "extra_voice_reply";
String replyLabel = getResources().getString(R.string.reply_label);
RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
        .setLabel(replyLabel)
        .build();
Voz com opções
public static final String EXTRA_VOICE_REPLY = "extra_voice_reply";
...
String replyLabel = getResources().getString(R.string.reply_label);
String[] replyChoices =
getResources().getStringArray(R.array.reply_choices);
RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)
        .setLabel(replyLabel)
        .setChoices(replyChoices)
        .build();
Voz// Create an intent for the reply action
Intent replyIntent = new Intent(this, ReplyActivity.class);
PendingIntent replyPendingIntent =
        PendingIntent.getActivity(this, 0, replyIntent,
                PendingIntent.FLAG_UPDATE_CURRENT);
// Create the reply action and add the remote input
NotificationCompat.Action action =
        new NotificationCompat.Action.Builder(R.drawable.ic_reply_icon,
                getString(R.string.label), replyPendingIntent)
                .addRemoteInput(remoteInput)
                .build();
// Build the notification and add the action via WearableExtender
Notification notification =
        new NotificationCompat.Builder(mContext)
                .setSmallIcon(R.drawable.ic_message)
                .setContentTitle(getString(R.string.title))
                .setContentText(getString(R.string.content))
                .extend(new WearableExtender().addAction(action))
                .build();
Voz
private CharSequence getMessageText(Intent intent) {
    Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);
    if (remoteInput != null) {
        return remoteInput.getCharSequence(EXTRA_VOICE_REPLY);
    }
    return null;
}
Paginação
Paginação
NotificationCompat.Builder notificationBuilder =
        new NotificationCompat.Builder(this)
        .setSmallIcon(R.drawable.new_message)
        .setContentTitle("Page 1")
        .setContentText("Short message")
        .setContentIntent(viewPendingIntent);
Paginação
BigTextStyle secondPageStyle = new NotificationCompat.BigTextStyle();
secondPageStyle.setBigContentTitle("Page 2")
               .bigText("A lot of text...");
// Create second page notification
Notification secondPageNotification =
        new NotificationCompat.Builder(this)
        .setStyle(secondPageStyle)
        .build();
Paginação
// Extend the notification builder with the second page
Notification notification = notificationBuilder
        .extend(new NotificationCompat.WearableExtender()
                .addPage(secondPageNotification))
        .build();
Pilha
Pilha
setGroup com mesmo ID
Pilha
Notification notif = new NotificationCompat.Builder(mContext)
         .setContentTitle("New mail from " + sender1)
         .setContentText(subject1)
         .setSmallIcon(R.drawable.new_mail)
         .setGroup(GROUP_KEY_EMAILS)
         .build();
…
Notification notif2 = new NotificationCompat.Builder(mContext)
         .setContentTitle("New mail from " + sender2)
         .setContentText(subject2)
         .setSmallIcon(R.drawable.new_mail)
         .setGroup(GROUP_KEY_EMAILS)
         .build();
Wearable Apps
O que não tem
• android.webkit
• android.print
• android.app.backup
• android.appwidget
• android.hardware.usb
Requisitos
• SDK tools versão 23.0.0 ou superior
• SDK Android 4.4W (API 20)
Custom notification
public void onCreate(Bundle bundle){
    ...
    setContentView(R.layout.notification_activity);
}
<activity android:name="com.example.NotificationActivity"
     android:exported="true"
     android:allowEmbedded="true"
     android:theme="@android:style/Theme.DeviceDefault.Light" />
Intent notificationIntent = new Intent(this,
NotificationActivity.class);
PendingIntent notificationPendingIntent =
PendingIntent.getActivity(this, 0, notificationIntent,
        PendingIntent.FLAG_UPDATE_CURRENT);
Layouts
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
    <TextView
        android:id="@+id/text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_square" />
</LinearLayout>
Layouts
Layouts
compile 'com.google.android.support:wearable:+'
Layouts
<android.support.wearable.view.WatchViewStub
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/watch_view_stub"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:rectLayout="@layout/rect_activity_wear"
    app:roundLayout="@layout/round_activity_wear">
</android.support.wearable.view.WatchViewStub>
Layouts
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_wear);
}
Layouts
<android.support.wearable.view.BoxInsetLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_height="match_parent"
    android:layout_width=“match_parent>
…
</android.support.wearable.view.BoxInsetLayout>
Layouts
Layouts
• android.support.wearable.view.BoxInsetLayout
• android.support.wearable.view.CardScrollView
• android.support.wearable.view.CardFrame
• android.support.wearable.view.WearableListView
• WearableListView.Adapter
O que mais?
• Transferência de dados entre wearable e device:
• Wearable Data Layer
• Cloud sync
• getConnectedNodes(), MessageApi, NodeApi,
CapabilityApi
O que mais?
• Watch Face:
• CanvasWatchFaceService,
CanvasWatchFaceService.Engine…
• Always-on Apps
• Browse media (android.media.browse API)
Próximos passos?
• http://developer.android.com/wear/
WatchFace
• https://github.com/ustwo/Clockwise
• http://wear.ustwo.com
Obrigado
Obrigado
+DouglasDrumond
@douglasdrumond
www.cafelinear.com

www.robotodojo.com
douglas@roboto.ninja
+GdgCampinasOrg
@gdgcampinas
www.gdg-campinas.org

More Related Content

Similar to Android Wear – IO Extended

Developing for android wear
Developing for android wearDeveloping for android wear
Developing for android wearThomas Oldervoll
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your appVitali Pekelis
 
Android Wearables ii
Android Wearables iiAndroid Wearables ii
Android Wearables iiKetan Raval
 
Getting Ready For Android Wear
Getting Ready For Android WearGetting Ready For Android Wear
Getting Ready For Android WearRaveesh Bhalla
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Weargabrielemariotti
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...mharkus
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android WearPeter Friese
 
Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callmaamir farooq
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Alfredo Morresi
 
Dicoding Developer Coaching #22: Android | Cara Membuat Notifikasi di Aplikas...
Dicoding Developer Coaching #22: Android | Cara Membuat Notifikasi di Aplikas...Dicoding Developer Coaching #22: Android | Cara Membuat Notifikasi di Aplikas...
Dicoding Developer Coaching #22: Android | Cara Membuat Notifikasi di Aplikas...DicodingEvent
 
8º Betabeers Granada: Android Wear por GDG Granada
8º Betabeers Granada: Android Wear por GDG Granada8º Betabeers Granada: Android Wear por GDG Granada
8º Betabeers Granada: Android Wear por GDG GranadaJM Robles
 
Handling action bar in Android
Handling action bar in AndroidHandling action bar in Android
Handling action bar in Androidindiangarg
 

Similar to Android Wear – IO Extended (20)

Developing for android wear
Developing for android wearDeveloping for android wear
Developing for android wear
 
Session #8 adding magic to your app
Session #8  adding magic to your appSession #8  adding magic to your app
Session #8 adding magic to your app
 
Android Wear Development
Android Wear DevelopmentAndroid Wear Development
Android Wear Development
 
Notification android
Notification androidNotification android
Notification android
 
Android Wearables ii
Android Wearables iiAndroid Wearables ii
Android Wearables ii
 
Getting Ready For Android Wear
Getting Ready For Android WearGetting Ready For Android Wear
Getting Ready For Android Wear
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
GDG GeorgeTown Devfest 2014 Presentation: Android Wear: A Developer's Perspec...
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
Exercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone callExercises broadcast receiver,incoming phone call
Exercises broadcast receiver,incoming phone call
 
Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)Slightly Advanced Android Wear ;)
Slightly Advanced Android Wear ;)
 
Dicoding Developer Coaching #22: Android | Cara Membuat Notifikasi di Aplikas...
Dicoding Developer Coaching #22: Android | Cara Membuat Notifikasi di Aplikas...Dicoding Developer Coaching #22: Android | Cara Membuat Notifikasi di Aplikas...
Dicoding Developer Coaching #22: Android | Cara Membuat Notifikasi di Aplikas...
 
Notifications
NotificationsNotifications
Notifications
 
Android For All The Things
Android For All The ThingsAndroid For All The Things
Android For All The Things
 
8º Betabeers Granada: Android Wear por GDG Granada
8º Betabeers Granada: Android Wear por GDG Granada8º Betabeers Granada: Android Wear por GDG Granada
8º Betabeers Granada: Android Wear por GDG Granada
 
Introduction to Android Wear
Introduction to Android WearIntroduction to Android Wear
Introduction to Android Wear
 
Dependency Injection for Android
Dependency Injection for AndroidDependency Injection for Android
Dependency Injection for Android
 
20 Codigos
20 Codigos20 Codigos
20 Codigos
 
Simplest calculator app using android studio android workshop
Simplest calculator app using android studio   android workshopSimplest calculator app using android studio   android workshop
Simplest calculator app using android studio android workshop
 
Handling action bar in Android
Handling action bar in AndroidHandling action bar in Android
Handling action bar in Android
 

More from Douglas Drumond

[MobCamp 2014] Android Wear and Google Glass
[MobCamp 2014] Android Wear and Google Glass[MobCamp 2014] Android Wear and Google Glass
[MobCamp 2014] Android Wear and Google GlassDouglas Drumond
 
[DevCamp 2014] Melhorando a Usabilidade com Animações
[DevCamp 2014] Melhorando a Usabilidade com Animações[DevCamp 2014] Melhorando a Usabilidade com Animações
[DevCamp 2014] Melhorando a Usabilidade com AnimaçõesDouglas Drumond
 
[DevCamp 2014] Melhorando a usabilidade com animações
[DevCamp 2014] Melhorando a usabilidade com animações[DevCamp 2014] Melhorando a usabilidade com animações
[DevCamp 2014] Melhorando a usabilidade com animaçõesDouglas Drumond
 
[Unicamp Fórum Permanente] Android Faixa Branca – 2011
[Unicamp Fórum Permanente] Android Faixa Branca – 2011[Unicamp Fórum Permanente] Android Faixa Branca – 2011
[Unicamp Fórum Permanente] Android Faixa Branca – 2011Douglas Drumond
 
[MO901] Android 下忍 – 2011
[MO901] Android 下忍 – 2011[MO901] Android 下忍 – 2011
[MO901] Android 下忍 – 2011Douglas Drumond
 
[FLISOL] Embelezando o Android – 2013
[FLISOL] Embelezando o Android – 2013[FLISOL] Embelezando o Android – 2013
[FLISOL] Embelezando o Android – 2013Douglas Drumond
 
[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013
[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013
[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013Douglas Drumond
 
[Faat] android faixa branca – 2012
[Faat] android faixa branca – 2012[Faat] android faixa branca – 2012
[Faat] android faixa branca – 2012Douglas Drumond
 
[DevCamp] Layouts Flexíveis no Android – 2013
[DevCamp] Layouts Flexíveis no Android – 2013[DevCamp] Layouts Flexíveis no Android – 2013
[DevCamp] Layouts Flexíveis no Android – 2013Douglas Drumond
 
[Android devcamp] Android Bootcamp – 2012
[Android devcamp] Android Bootcamp – 2012[Android devcamp] Android Bootcamp – 2012
[Android devcamp] Android Bootcamp – 2012Douglas Drumond
 
[Unicamp] curso vim – 2010
[Unicamp] curso vim – 2010[Unicamp] curso vim – 2010
[Unicamp] curso vim – 2010Douglas Drumond
 

More from Douglas Drumond (11)

[MobCamp 2014] Android Wear and Google Glass
[MobCamp 2014] Android Wear and Google Glass[MobCamp 2014] Android Wear and Google Glass
[MobCamp 2014] Android Wear and Google Glass
 
[DevCamp 2014] Melhorando a Usabilidade com Animações
[DevCamp 2014] Melhorando a Usabilidade com Animações[DevCamp 2014] Melhorando a Usabilidade com Animações
[DevCamp 2014] Melhorando a Usabilidade com Animações
 
[DevCamp 2014] Melhorando a usabilidade com animações
[DevCamp 2014] Melhorando a usabilidade com animações[DevCamp 2014] Melhorando a usabilidade com animações
[DevCamp 2014] Melhorando a usabilidade com animações
 
[Unicamp Fórum Permanente] Android Faixa Branca – 2011
[Unicamp Fórum Permanente] Android Faixa Branca – 2011[Unicamp Fórum Permanente] Android Faixa Branca – 2011
[Unicamp Fórum Permanente] Android Faixa Branca – 2011
 
[MO901] Android 下忍 – 2011
[MO901] Android 下忍 – 2011[MO901] Android 下忍 – 2011
[MO901] Android 下忍 – 2011
 
[FLISOL] Embelezando o Android – 2013
[FLISOL] Embelezando o Android – 2013[FLISOL] Embelezando o Android – 2013
[FLISOL] Embelezando o Android – 2013
 
[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013
[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013
[FLISOL] Android Faixa Branca (Iniciando no Android) – 2013
 
[Faat] android faixa branca – 2012
[Faat] android faixa branca – 2012[Faat] android faixa branca – 2012
[Faat] android faixa branca – 2012
 
[DevCamp] Layouts Flexíveis no Android – 2013
[DevCamp] Layouts Flexíveis no Android – 2013[DevCamp] Layouts Flexíveis no Android – 2013
[DevCamp] Layouts Flexíveis no Android – 2013
 
[Android devcamp] Android Bootcamp – 2012
[Android devcamp] Android Bootcamp – 2012[Android devcamp] Android Bootcamp – 2012
[Android devcamp] Android Bootcamp – 2012
 
[Unicamp] curso vim – 2010
[Unicamp] curso vim – 2010[Unicamp] curso vim – 2010
[Unicamp] curso vim – 2010
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Android Wear – IO Extended

  • 2.
  • 3.
  • 4.
  • 6.
  • 7.
  • 17. Ação só p/ relógio // Create an intent for the reply action Intent actionIntent = new Intent(this, ActionActivity.class); PendingIntent actionPendingIntent =         PendingIntent.getActivity(this, 0, actionIntent,                 PendingIntent.FLAG_UPDATE_CURRENT); // Create the action NotificationCompat.Action action =         new NotificationCompat.Action.Builder(R.drawable.ic_action,                 getString(R.string.label), actionPendingIntent)                 .build(); // Build the notification and add the action via WearableExtender Notification notification =         new NotificationCompat.Builder(mContext)                 .setSmallIcon(R.drawable.ic_message)                 .setContentTitle(getString(R.string.title))                 .setContentText(getString(R.string.content))                 .extend(new WearableExtender().addAction(action))                 .build();
  • 18. Voz // Key for the string that's delivered in the action's intent private static final String EXTRA_VOICE_REPLY = "extra_voice_reply"; String replyLabel = getResources().getString(R.string.reply_label); RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)         .setLabel(replyLabel)         .build();
  • 19. Voz com opções public static final String EXTRA_VOICE_REPLY = "extra_voice_reply"; ... String replyLabel = getResources().getString(R.string.reply_label); String[] replyChoices = getResources().getStringArray(R.array.reply_choices); RemoteInput remoteInput = new RemoteInput.Builder(EXTRA_VOICE_REPLY)         .setLabel(replyLabel)         .setChoices(replyChoices)         .build();
  • 20. Voz// Create an intent for the reply action Intent replyIntent = new Intent(this, ReplyActivity.class); PendingIntent replyPendingIntent =         PendingIntent.getActivity(this, 0, replyIntent,                 PendingIntent.FLAG_UPDATE_CURRENT); // Create the reply action and add the remote input NotificationCompat.Action action =         new NotificationCompat.Action.Builder(R.drawable.ic_reply_icon,                 getString(R.string.label), replyPendingIntent)                 .addRemoteInput(remoteInput)                 .build(); // Build the notification and add the action via WearableExtender Notification notification =         new NotificationCompat.Builder(mContext)                 .setSmallIcon(R.drawable.ic_message)                 .setContentTitle(getString(R.string.title))                 .setContentText(getString(R.string.content))                 .extend(new WearableExtender().addAction(action))                 .build();
  • 21. Voz private CharSequence getMessageText(Intent intent) {     Bundle remoteInput = RemoteInput.getResultsFromIntent(intent);     if (remoteInput != null) {         return remoteInput.getCharSequence(EXTRA_VOICE_REPLY);     }     return null; }
  • 23. Paginação NotificationCompat.Builder notificationBuilder =         new NotificationCompat.Builder(this)         .setSmallIcon(R.drawable.new_message)         .setContentTitle("Page 1")         .setContentText("Short message")         .setContentIntent(viewPendingIntent);
  • 24. Paginação BigTextStyle secondPageStyle = new NotificationCompat.BigTextStyle(); secondPageStyle.setBigContentTitle("Page 2")                .bigText("A lot of text..."); // Create second page notification Notification secondPageNotification =         new NotificationCompat.Builder(this)         .setStyle(secondPageStyle)         .build();
  • 25. Paginação // Extend the notification builder with the second page Notification notification = notificationBuilder         .extend(new NotificationCompat.WearableExtender()                 .addPage(secondPageNotification))         .build();
  • 26. Pilha
  • 28. Pilha Notification notif = new NotificationCompat.Builder(mContext)          .setContentTitle("New mail from " + sender1)          .setContentText(subject1)          .setSmallIcon(R.drawable.new_mail)          .setGroup(GROUP_KEY_EMAILS)          .build(); … Notification notif2 = new NotificationCompat.Builder(mContext)          .setContentTitle("New mail from " + sender2)          .setContentText(subject2)          .setSmallIcon(R.drawable.new_mail)          .setGroup(GROUP_KEY_EMAILS)          .build();
  • 30. O que não tem • android.webkit • android.print • android.app.backup • android.appwidget • android.hardware.usb
  • 31. Requisitos • SDK tools versão 23.0.0 ou superior • SDK Android 4.4W (API 20)
  • 32. Custom notification public void onCreate(Bundle bundle){     ...     setContentView(R.layout.notification_activity); } <activity android:name="com.example.NotificationActivity"      android:exported="true"      android:allowEmbedded="true"      android:theme="@android:style/Theme.DeviceDefault.Light" /> Intent notificationIntent = new Intent(this, NotificationActivity.class); PendingIntent notificationPendingIntent = PendingIntent.getActivity(this, 0, notificationIntent,         PendingIntent.FLAG_UPDATE_CURRENT);
  • 33. Layouts <LinearLayout xmlns:android="http://schemas.android.com/apk/res/ android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="vertical">     <TextView         android:id="@+id/text"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="@string/hello_square" /> </LinearLayout>
  • 36. Layouts <android.support.wearable.view.WatchViewStub     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/watch_view_stub"     android:layout_width="match_parent"     android:layout_height="match_parent"     app:rectLayout="@layout/rect_activity_wear"     app:roundLayout="@layout/round_activity_wear"> </android.support.wearable.view.WatchViewStub>
  • 37. Layouts @Override protected void onCreate(Bundle savedInstanceState) {     super.onCreate(savedInstanceState);     setContentView(R.layout.activity_wear); }
  • 38. Layouts <android.support.wearable.view.BoxInsetLayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     android:layout_height="match_parent"     android:layout_width=“match_parent> … </android.support.wearable.view.BoxInsetLayout>
  • 40. Layouts • android.support.wearable.view.BoxInsetLayout • android.support.wearable.view.CardScrollView • android.support.wearable.view.CardFrame • android.support.wearable.view.WearableListView • WearableListView.Adapter
  • 41. O que mais? • Transferência de dados entre wearable e device: • Wearable Data Layer • Cloud sync • getConnectedNodes(), MessageApi, NodeApi, CapabilityApi
  • 42. O que mais? • Watch Face: • CanvasWatchFaceService, CanvasWatchFaceService.Engine… • Always-on Apps • Browse media (android.media.browse API)