SlideShare uma empresa Scribd logo
1 de 46
Baixar para ler 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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

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)