SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
APPLICATION DEVELOPMENT WITH
   TOUCH AND SENSORS ON
  ULTRABOOKTM / WINDOWS 8

         Sulamita Garcia – sulamita.garcia@intel.com
                Technical Marketing Engineer
                    Twitter @sulagarcia



                           Copyright© 2012, Intel Corporation. All rights reserved.
                     *Other brands and names are the property of their respective owners
                                                                                           1
/me
MAHJONG DEMO HERE




         Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners
                                                                                                                                        3
Using touch in a desktop application
• Touch and gestures
   –   Tap/Double tap                                                                              –             Zoom
   –   Panning with inertia                                                                        –             Rotate
   –   Selection/Drag                                                                              –             Two-finger tap
   –   Press and tap                                                                               –             Flicks
   –   Press and hold
• Do’s and Don’t of gesture interfaces
• Demo: Use touch and gestures to select, move and
  manipulate three images
• The Windows Touch API
• Using touch with XMAL

                      Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                     4
Adding touch to a desktop application
•    Touch is not a mouse
•    Make touch targets large enough
•    Support standard gestures and behaviors
•    Portrait vs. Landscape
•    Do not use touch just for touch’s sake
•    Touch should be forgiving
•    Microsoft User Experience Guidelines
     – msdn.microsoft.com/en-
       us/library/windows/desktop/cc872774.aspx
     – blogs.msdn.com/b/ie/archive/2012/04/20/guidelines-for-
       building-touch-friendly-sites.aspx

                     Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                    5
Designing for Touch User Experience
• Design UI to include traditional laptop style and tablet
  mode usages
• Space and size controls to register fuzzy touch input
        – Common Controls: 23X23 pixels
        – Command Controls: 40X40 pixels
• Use multiple form tabs for touch efficiency
• Consider the target size while designing your
  application UI
• Use natural and intuitive controls
• Ultrabook Optimal Resolution: 1366X768
Source: MSDN
http://msdn.microsoft.com/en-us/library/windows/desktop/cc872774.aspx#guidelines




                                                              Copyright(C) 2012 Intel Corporation. All rights reserved.
                                                         *Other brands and names are properties of their respective owners.
                                                                                                                              6
Designing for Touch User Experience
• Use common controls as much as possible
• Choose custom controls that support touch
• Prefer constrained controls to unconstrained
  controls
• Provide default values and auto text-
  completion
• Use check boxes instead of multiple selection
  lists
Source: MSDN
http://msdn.microsoft.com/en-us/library/windows/desktop/cc872774.aspx#guidelines



                                                         Copyright(C) 2012 Intel Corporation. All rights reserved.
                                                    *Other brands and names are properties of their respective owners.
                                                                                                                         7
Designing for Touch User Experience
• Place controls in areas better utilized for touch
• Command controls should be more easily
  accessible




                         Copyright(C) 2012 Intel Corporation. All rights reserved.
                    *Other brands and names are properties of their respective owners.
                                                                                         8
Using Windows Touch API
• Touch and gesture events are delivered via Windows
  Touch messages
   – Windows must register for Windows Touch input
• WM_TOUCH reports action, position and identifier
• WM_GESTURE describes the gesture via GESTUREINFO
  structure
• Special interfaces to help process gesture messages
   – IManipulationProcessor
   – IInertiaProcessor
• API reference at msdn.microsoft.com/en-
  us/library/windows/desktop/dd371406%28v=vs.85%2
  9.aspx




                          Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                         9
Sensors and Windows Native
• Sensor manager controls sensors
  – Use sensor manager to get to sensors
  – Notifies when a sensor connects
• Sensors report data, changes in state and
  disconnection
• Access both via COM interfaces
  – Use API to communicate to sensors
  – Sensor events handled using callbacks
  – API reference at msdn.microsoft.com/en-
    us/library/windows/desktop/dd318953%28v=vs.85%2
    9.aspx

                 Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                10
WinNative: Receive gesture message
                                                                                    LRESULT CALLBACK
                                                                                        WndProc(…)
                                                                                    {
                                                                                      …
                                                                                      switch (message)
                                                                                      {
• Check for                                                                             case WM_GESTURE:
                                                                                          // Call code to
  WM_GESTURE message                                                                      // interpret the
  in WndProc                                                                              // gesture
                                                                                          return
                                                                                            DecodeGesture(…);
                                                                                        …
                                                                                    }

                                                                                                                                             (Source: Microsoft)


              Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                            11
WinNative: Process gesture
                                                                                        LRESULT DecodeGesture(…)
                                                                                        {
• Retrieve the additional                                                                 …
                                                                                          BOOL bResult = GetGestureInfo(…);
  gesture information from                                                                      BOOL bHandled = FALSE;
  the GESTUREINFO                                                                               if (bResult)
  structure                                                                                     {
                                                                                                  // now interpret the gesture
                                                                                                  switch (gi.dwID){
                                                                                                    case GID_ZOOM :
                                                                                                      // Code for zooming goes here
                                                                                                      bHandled = TRUE;
• Handle each of the                                                                                  break;
                                                                                                    case GID_PAN :
  possible gestures                                                                                   …
                                                                                                    case GID_ROTATE :
                                                                                                      …
                                                                                                    case GID_TWOFINGERTAP:
                                                                                                      …
                                                                                                    case GID_PRESSANDTAP:
                                                                                                      …
                                                                                                    default:
                                                                                                     // A gesture was not recognized
                                                                                                     break;
                                                                                                  }     …                      (Source: Microsoft)

                  Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                 12
Demo
• New Windows*8 UI
  application
  – Full screen
  – Borderless window
• Desktop application
  – Runs in desktop
    environment                                                                                                                                Source: Microsoft



  – Multiple windows
  – Can support touch and sensors

                Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners
                                                                                                                                                              13
Using touch and XAML/.NET
• XAML provides access to WPF touch-enabled
  UI components
  – WPF touchs event are available in both Windows* 7 and
    Windows* 8.
• Typical gesture events:
  – ManipulationStarting
  – ManipulationDelta
  – ManipulationInertiaStarting



                   Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                  14
XAML: TouchControl.xaml
                                                                        <UserControl x:Class="Win8Demo.TouchControl"
• Three images placed in                                                    …>

  a Grid inside of a                                                        <Grid x:Name="cont" ClipToBounds="True" >
                                                                                <!-- Set the IsManipulationEnabled to

  TouchControl                                                                   true -->
                                                                                <Image x:Name="photo_1"
                                                                                  Source="/Assets/ultrabook1.png“
                                                                                  IsManipulationEnabled="True"
                                                                                  Width="500" />

• Each image has                                                                <Image x:Name="photo_2“
                                                                                  Source="/Assets/ultrabook2.png“

  IsManipulationEnabled                                                           IsManipulationEnabled="True“
                                                                                  Width="500" Margin="125,-79,25,79"/>
                                                                                <Image x:Name="photo_3“
  set to true                                                                     Source="/Assets/ultrabook3.png“
                                                                                  IsManipulationEnabled="True“
                                                                                  Width="500" Margin="0,-59,150,59" />
                                                                            </Grid>
                                                                        </UserControl>




                 Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                15
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        16
XAML: TouchControl.xaml.cs
                                                                                 public TouchControl()
                                                                                 {
                                                                                    …

                                                                                              //Register for manipulation events

• Add event handlers to                                                                       photo_1.ManipulationStarting +=
                                                                                                 m_rect_ManipulationStarting;
                                                                                              photo_1.ManipulationDelta +=
  each image for:                                                                                m_rect_ManipulationDelta;
                                                                                              photo_1.ManipulationInertiaStarting +=
  •ManipulationStarting                                                                          m_rect_ManipulationInertiaStarting;

  •ManipulationDelta                                                                          photo_2.ManipulationStarting += …
  •ManipulationInertiaStarting                                                                photo_3.ManipulationStarting += …
                                                                                 }




                      Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                     17
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        18
XAML: Manipulation starting event
              handler
• ManipulationStarting event                                                                 void
  handler is called at start of                                                              m_rect_ManipulationStarting
  touch event                                                                                (…)
                                                                                             {
                                                                                               …
• By setting Manipulation-                                                                     e.ManipulationContainer =
  Container to the touched                                                                      this;
  image all subsequent
  manipulation events will be                                                                }
  relative to that element




                       Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                      19
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        20
XAML: Manipulation delta event
               handler
• ManipulationDelta                                          void m_rect_ManipulationDelta(…)
                                                             {
  event happens as user                                        …
                                                               //Get the manipulation’s delta
  moves fingers                                                var delta = e.DeltaManipulation;

                                                                      //Compute the transformed center point
                                                                      Point rectCenter = new Point(rect.ActualWidth *
                                                                        0.5, rect.ActualHeight * 0.5);
• Compute new image                                                   rectCenter = matrix.Transform(rectCenter);

  center point, scale, and                                            //Adjust the element’s scale, rotation and
                                                                        translation
  rotation using event                                                matrix.ScaleAt(delta.Scale.X, delta.Scale.Y,
                                                                        rectCenter.X, rectCenter.Y);
  data                                                                matrix.RotateAt(delta.Rotation, rectCenter.X,
                                                                        rectCenter.Y);
                                                                      matrix.Translate(delta.Translation.X,
                                                                        delta.Translation.Y);

• Set Handled to true so                                              //Update the element’s render transformation
                                                                      rect.RenderTransform =
  other handlers don’t                                                  new MatrixTransform(matrix);
  process same event                                                  e.Handled = true;


                     Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                    21
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        22
XAML: Inertia starting event handler
•   Inertia actions are handled by the                                                   void m_rect_ManipulationInertiaStarting(…)
                                                                                         {
    ManipulationInertiaStarting event                                                      //Set the manipulations inertia values
    handler                                                                                e.TranslationBehavior = new
                                                                                             InertiaTranslationBehavior()
•   Define the behavior of the inertia                                                       {
    by specifying                                                                               InitialVelocity =
                                                                                                e.InitialVelocities.LinearVelocity,
     • Linear velocity                                                                          DesiredDeceleration =…
     • Deceleration                                                                          };
     • Expansion velocity (used in                                                         e.ExpansionBehavior = new
                                                                                             InertiaExpansionBehavior()
         pinch or spread)                                                                    {
     • Angular velocity (used in                                                                InitialVelocity =
                                                                                                e.InitialVelocities.ExpansionVelocity,
         rotation)                                                                              DesiredDeceleration = …
                                                                                             };
                                                                                           e.RotationBehavior = new
                                                                                             InertiaRotationBehavior()
                                                                                             {
                                                                                                InitialVelocity =
•   Again, set Handled to true so other                                                         e.InitialVelocities.AngularVelocity,
                                                                                                DesiredDeceleration = …
    handlers don’t process same event                                                        };
                                                                                           e.Handled = true;…

                           Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                          23
Touch Event State Diagram
                               Events begin with User
Manipulation                   Touching the Image
  Starting

                                                                                         Manipulation
                   Manipulation
                                                                                            Delta
Manipulation      Inertia Starting
                                                                                          w/ Inertia
   Delta
                               User finger is lifted from the
                                          screen
 User finger is
 touching the
    screen                                                                               Manipulation
                                                                                          Completed
                         Copyright© 2012, Intel Corporation. All rights reserved.
                   *Other brands and names are the property of their respective owners
                                                                                                        24
XAML: Handle inertia manipulation
                                                                                               if (e.IsInertial)
• Check if inertia is moving the                                                                {
  image across the grid                                                                           //Get the containing element’s size
                                                                                                  Rect containingRect = …
                                                                                                     (e.ManipulationContainer).RenderSize);
                                                                                                  //Get the transformed element’s new
                                                                                                  //bounds
                                                                                                  Rect shapeBounds =
                                                                                                     rect.RenderTransform.TransformBounds
                                                                                                     (…);
                                                                                                  //If element falls out of bounds
• If so, make sure image does not                                                                 if
                                                                                                  (!containingRect.Contains(shapeBounds))
  travel outside of the grid by                                                                   {
                                                                                                     //Report boundary feedback
  calling the Complete method to                                                                     e.ReportBoundaryFeedback(…);
  end the inertia                                                                                    //Stop any after inertia
                                                                                                     e.Complete();
                                                                                                  }
                                                                                                }
                                                                                         …




                         Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners.
                                                                                                                                                        25
References
• Intel Ultrabook™ Community
• Intel® Software Network
  – software.intel.com
• Windows Development Reference
  – msdn.microsoft.com/en-
    us/library/windows/desktop/hh447209%28v=vs.85%2
    9.aspx
• WinRT API Reference
  – msdn.microsoft.com/en-
    us/library/windows/apps/br211377.aspx

                 Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners
                                                                                                                                                26
Q&A


Sulamita Garcia – sulamita.garcia@intel.com
       Technical Marketing Engineer
           Twitter @sulagarcia




            Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners
                                                                                                                                           27

Mais conteúdo relacionado

Mais procurados

Kl ftf channel desktop roadmap final
Kl ftf channel desktop roadmap finalKl ftf channel desktop roadmap final
Kl ftf channel desktop roadmap final
Aju Poduval
 
Extending softwareintomobile 11 28-2012
Extending softwareintomobile 11 28-2012Extending softwareintomobile 11 28-2012
Extending softwareintomobile 11 28-2012
CorSource
 

Mais procurados (20)

Intel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General InformationIntel AppUp Webinar Italiano General Information
Intel AppUp Webinar Italiano General Information
 
MeeGo Overview DeveloperDay Munich
MeeGo Overview DeveloperDay MunichMeeGo Overview DeveloperDay Munich
MeeGo Overview DeveloperDay Munich
 
Intel AppUp™ SDK Suite 1.2 for MeeGo
Intel AppUp™ SDK Suite 1.2 for MeeGoIntel AppUp™ SDK Suite 1.2 for MeeGo
Intel AppUp™ SDK Suite 1.2 for MeeGo
 
Writing applications for multiple stores on the WeTab
Writing applications for multiple stores on the WeTabWriting applications for multiple stores on the WeTab
Writing applications for multiple stores on the WeTab
 
Deploying Intel Architecture-based Tablets with Windows* 8 at Intel
Deploying Intel Architecture-based Tablets with Windows* 8 at IntelDeploying Intel Architecture-based Tablets with Windows* 8 at Intel
Deploying Intel Architecture-based Tablets with Windows* 8 at Intel
 
Android application development
Android application developmentAndroid application development
Android application development
 
Kl ftf channel desktop roadmap final
Kl ftf channel desktop roadmap finalKl ftf channel desktop roadmap final
Kl ftf channel desktop roadmap final
 
UX: Raising the bar with Software Development by Sulamita Garcia from Intel
UX: Raising the bar with Software Development by Sulamita Garcia from IntelUX: Raising the bar with Software Development by Sulamita Garcia from Intel
UX: Raising the bar with Software Development by Sulamita Garcia from Intel
 
Windows 8 hardware sensors
Windows 8 hardware sensorsWindows 8 hardware sensors
Windows 8 hardware sensors
 
MeeGo AppLab Desktop Summit 2011 - AppUp
MeeGo AppLab Desktop Summit 2011 - AppUpMeeGo AppLab Desktop Summit 2011 - AppUp
MeeGo AppLab Desktop Summit 2011 - AppUp
 
Intel Real Sense, Diversity Meetup by Jamie Tanna
Intel Real Sense, Diversity Meetup by Jamie TannaIntel Real Sense, Diversity Meetup by Jamie Tanna
Intel Real Sense, Diversity Meetup by Jamie Tanna
 
IT@Intel: Creating Smart Spaces with All-in-Ones
IT@Intel:  Creating Smart Spaces with All-in-OnesIT@Intel:  Creating Smart Spaces with All-in-Ones
IT@Intel: Creating Smart Spaces with All-in-Ones
 
Chapter 05
Chapter 05Chapter 05
Chapter 05
 
Meego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea GrandiMeego Italian Day 2011 – Andrea Grandi
Meego Italian Day 2011 – Andrea Grandi
 
Compound Versus Elemental Devices New Mobile Device Market Strategies 6.1...
Compound Versus Elemental Devices   New Mobile Device Market Strategies   6.1...Compound Versus Elemental Devices   New Mobile Device Market Strategies   6.1...
Compound Versus Elemental Devices New Mobile Device Market Strategies 6.1...
 
The changing computer for small biz
The changing computer for small bizThe changing computer for small biz
The changing computer for small biz
 
Windows phone
Windows phoneWindows phone
Windows phone
 
A Glimpse On MeeGo
A Glimpse On MeeGoA Glimpse On MeeGo
A Glimpse On MeeGo
 
Sikuli
SikuliSikuli
Sikuli
 
Extending softwareintomobile 11 28-2012
Extending softwareintomobile 11 28-2012Extending softwareintomobile 11 28-2012
Extending softwareintomobile 11 28-2012
 

Semelhante a Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin

SMARCOS HIG Paper on Designing Touch Screen Interfaces
SMARCOS HIG Paper on Designing Touch Screen InterfacesSMARCOS HIG Paper on Designing Touch Screen Interfaces
SMARCOS HIG Paper on Designing Touch Screen Interfaces
Smarcos Eu
 
Building a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale systemBuilding a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale system
Chris Eargle
 

Semelhante a Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin (20)

Designing for Touch and Sensor for Mobiles & Tablets
Designing for Touch and Sensor for Mobiles & TabletsDesigning for Touch and Sensor for Mobiles & Tablets
Designing for Touch and Sensor for Mobiles & Tablets
 
Moderne device management door middel van cloud
Moderne device management door middel van cloudModerne device management door middel van cloud
Moderne device management door middel van cloud
 
600.250 UI Cross Platform Development and the Android Security Model
600.250 UI Cross Platform Development and the Android Security Model600.250 UI Cross Platform Development and the Android Security Model
600.250 UI Cross Platform Development and the Android Security Model
 
Developing Multi Touch Applications
Developing Multi Touch ApplicationsDeveloping Multi Touch Applications
Developing Multi Touch Applications
 
Manu
ManuManu
Manu
 
Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8Utilisation des capteurs dans les applications windows 8
Utilisation des capteurs dans les applications windows 8
 
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
LUMIA APP LABS: GAMES DEVELOPMENT USING WINDOWS PHONE 8
 
Pc03
Pc03Pc03
Pc03
 
Windows 10 Hybrid Development
Windows 10 Hybrid DevelopmentWindows 10 Hybrid Development
Windows 10 Hybrid Development
 
Embedded Virtualization for Mobile Devices
Embedded Virtualization for Mobile DevicesEmbedded Virtualization for Mobile Devices
Embedded Virtualization for Mobile Devices
 
SMARCOS HIG Paper on Designing Touch Screen Interfaces
SMARCOS HIG Paper on Designing Touch Screen InterfacesSMARCOS HIG Paper on Designing Touch Screen Interfaces
SMARCOS HIG Paper on Designing Touch Screen Interfaces
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Android Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and OrganizationAndroid Virtualization: Opportunity and Organization
Android Virtualization: Opportunity and Organization
 
Designing Rich Mobile Apps in a Fragmented World
Designing Rich Mobile Apps in a Fragmented WorldDesigning Rich Mobile Apps in a Fragmented World
Designing Rich Mobile Apps in a Fragmented World
 
Adapting Series 40 touch and type apps to the full-touch UI
Adapting Series 40 touch and type apps to the full-touch UIAdapting Series 40 touch and type apps to the full-touch UI
Adapting Series 40 touch and type apps to the full-touch UI
 
Touch Screen
Touch ScreenTouch Screen
Touch Screen
 
Win7 Multi Touch
Win7 Multi TouchWin7 Multi Touch
Win7 Multi Touch
 
Tablet pc
Tablet pcTablet pc
Tablet pc
 
Practical UI Guidelines for Wearable Apps
Practical UI Guidelines for Wearable AppsPractical UI Guidelines for Wearable Apps
Practical UI Guidelines for Wearable Apps
 
Building a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale systemBuilding a multi touch enabled windows 7 point of sale system
Building a multi touch enabled windows 7 point of sale system
 

Mais de Intel Developer Zone Community (8)

Intel Developer Zone MeetUp Intro
Intel Developer Zone MeetUp IntroIntel Developer Zone MeetUp Intro
Intel Developer Zone MeetUp Intro
 
Intel® Developer Zone
Intel® Developer ZoneIntel® Developer Zone
Intel® Developer Zone
 
Android and Intel Inside
Android and Intel InsideAndroid and Intel Inside
Android and Intel Inside
 
Ultrabook Development Using Sensors - Intel AppLab Berlin
Ultrabook Development Using Sensors - Intel AppLab BerlinUltrabook Development Using Sensors - Intel AppLab Berlin
Ultrabook Development Using Sensors - Intel AppLab Berlin
 
The New Windows UI - Intel Ultrabook AppLab Berlin
The New Windows UI - Intel Ultrabook AppLab BerlinThe New Windows UI - Intel Ultrabook AppLab Berlin
The New Windows UI - Intel Ultrabook AppLab Berlin
 
Intel AppUp Webinar Italiano html5
Intel AppUp Webinar Italiano html5Intel AppUp Webinar Italiano html5
Intel AppUp Webinar Italiano html5
 
Overview Intel AppUp developer program
Overview Intel AppUp developer programOverview Intel AppUp developer program
Overview Intel AppUp developer program
 
Getting Your Windows and MeeGo Apps into AppUp
Getting Your Windows and MeeGo Apps into AppUpGetting Your Windows and MeeGo Apps into AppUp
Getting Your Windows and MeeGo Apps into AppUp
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Ultrabook Development Using Touch - Intel Ultrabook AppLab Berlin

  • 1. APPLICATION DEVELOPMENT WITH TOUCH AND SENSORS ON ULTRABOOKTM / WINDOWS 8 Sulamita Garcia – sulamita.garcia@intel.com Technical Marketing Engineer Twitter @sulagarcia Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 1
  • 2. /me
  • 3. MAHJONG DEMO HERE Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 3
  • 4. Using touch in a desktop application • Touch and gestures – Tap/Double tap – Zoom – Panning with inertia – Rotate – Selection/Drag – Two-finger tap – Press and tap – Flicks – Press and hold • Do’s and Don’t of gesture interfaces • Demo: Use touch and gestures to select, move and manipulate three images • The Windows Touch API • Using touch with XMAL Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 4
  • 5. Adding touch to a desktop application • Touch is not a mouse • Make touch targets large enough • Support standard gestures and behaviors • Portrait vs. Landscape • Do not use touch just for touch’s sake • Touch should be forgiving • Microsoft User Experience Guidelines – msdn.microsoft.com/en- us/library/windows/desktop/cc872774.aspx – blogs.msdn.com/b/ie/archive/2012/04/20/guidelines-for- building-touch-friendly-sites.aspx Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 5
  • 6. Designing for Touch User Experience • Design UI to include traditional laptop style and tablet mode usages • Space and size controls to register fuzzy touch input – Common Controls: 23X23 pixels – Command Controls: 40X40 pixels • Use multiple form tabs for touch efficiency • Consider the target size while designing your application UI • Use natural and intuitive controls • Ultrabook Optimal Resolution: 1366X768 Source: MSDN http://msdn.microsoft.com/en-us/library/windows/desktop/cc872774.aspx#guidelines Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 6
  • 7. Designing for Touch User Experience • Use common controls as much as possible • Choose custom controls that support touch • Prefer constrained controls to unconstrained controls • Provide default values and auto text- completion • Use check boxes instead of multiple selection lists Source: MSDN http://msdn.microsoft.com/en-us/library/windows/desktop/cc872774.aspx#guidelines Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 7
  • 8. Designing for Touch User Experience • Place controls in areas better utilized for touch • Command controls should be more easily accessible Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 8
  • 9. Using Windows Touch API • Touch and gesture events are delivered via Windows Touch messages – Windows must register for Windows Touch input • WM_TOUCH reports action, position and identifier • WM_GESTURE describes the gesture via GESTUREINFO structure • Special interfaces to help process gesture messages – IManipulationProcessor – IInertiaProcessor • API reference at msdn.microsoft.com/en- us/library/windows/desktop/dd371406%28v=vs.85%2 9.aspx Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 9
  • 10. Sensors and Windows Native • Sensor manager controls sensors – Use sensor manager to get to sensors – Notifies when a sensor connects • Sensors report data, changes in state and disconnection • Access both via COM interfaces – Use API to communicate to sensors – Sensor events handled using callbacks – API reference at msdn.microsoft.com/en- us/library/windows/desktop/dd318953%28v=vs.85%2 9.aspx Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 10
  • 11. WinNative: Receive gesture message LRESULT CALLBACK WndProc(…) { … switch (message) { • Check for case WM_GESTURE: // Call code to WM_GESTURE message // interpret the in WndProc // gesture return DecodeGesture(…); … } (Source: Microsoft) Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 11
  • 12. WinNative: Process gesture LRESULT DecodeGesture(…) { • Retrieve the additional … BOOL bResult = GetGestureInfo(…); gesture information from BOOL bHandled = FALSE; the GESTUREINFO if (bResult) structure { // now interpret the gesture switch (gi.dwID){ case GID_ZOOM : // Code for zooming goes here bHandled = TRUE; • Handle each of the break; case GID_PAN : possible gestures … case GID_ROTATE : … case GID_TWOFINGERTAP: … case GID_PRESSANDTAP: … default: // A gesture was not recognized break; } … (Source: Microsoft) Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 12
  • 13. Demo • New Windows*8 UI application – Full screen – Borderless window • Desktop application – Runs in desktop environment Source: Microsoft – Multiple windows – Can support touch and sensors Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 13
  • 14. Using touch and XAML/.NET • XAML provides access to WPF touch-enabled UI components – WPF touchs event are available in both Windows* 7 and Windows* 8. • Typical gesture events: – ManipulationStarting – ManipulationDelta – ManipulationInertiaStarting Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 14
  • 15. XAML: TouchControl.xaml <UserControl x:Class="Win8Demo.TouchControl" • Three images placed in …> a Grid inside of a <Grid x:Name="cont" ClipToBounds="True" > <!-- Set the IsManipulationEnabled to TouchControl true --> <Image x:Name="photo_1" Source="/Assets/ultrabook1.png“ IsManipulationEnabled="True" Width="500" /> • Each image has <Image x:Name="photo_2“ Source="/Assets/ultrabook2.png“ IsManipulationEnabled IsManipulationEnabled="True“ Width="500" Margin="125,-79,25,79"/> <Image x:Name="photo_3“ set to true Source="/Assets/ultrabook3.png“ IsManipulationEnabled="True“ Width="500" Margin="0,-59,150,59" /> </Grid> </UserControl> Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 15
  • 16. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 16
  • 17. XAML: TouchControl.xaml.cs public TouchControl() { … //Register for manipulation events • Add event handlers to photo_1.ManipulationStarting += m_rect_ManipulationStarting; photo_1.ManipulationDelta += each image for: m_rect_ManipulationDelta; photo_1.ManipulationInertiaStarting += •ManipulationStarting m_rect_ManipulationInertiaStarting; •ManipulationDelta photo_2.ManipulationStarting += … •ManipulationInertiaStarting photo_3.ManipulationStarting += … } Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 17
  • 18. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 18
  • 19. XAML: Manipulation starting event handler • ManipulationStarting event void handler is called at start of m_rect_ManipulationStarting touch event (…) { … • By setting Manipulation- e.ManipulationContainer = Container to the touched this; image all subsequent manipulation events will be } relative to that element Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 19
  • 20. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 20
  • 21. XAML: Manipulation delta event handler • ManipulationDelta void m_rect_ManipulationDelta(…) { event happens as user … //Get the manipulation’s delta moves fingers var delta = e.DeltaManipulation; //Compute the transformed center point Point rectCenter = new Point(rect.ActualWidth * 0.5, rect.ActualHeight * 0.5); • Compute new image rectCenter = matrix.Transform(rectCenter); center point, scale, and //Adjust the element’s scale, rotation and translation rotation using event matrix.ScaleAt(delta.Scale.X, delta.Scale.Y, rectCenter.X, rectCenter.Y); data matrix.RotateAt(delta.Rotation, rectCenter.X, rectCenter.Y); matrix.Translate(delta.Translation.X, delta.Translation.Y); • Set Handled to true so //Update the element’s render transformation rect.RenderTransform = other handlers don’t new MatrixTransform(matrix); process same event e.Handled = true; Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 21
  • 22. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 22
  • 23. XAML: Inertia starting event handler • Inertia actions are handled by the void m_rect_ManipulationInertiaStarting(…) { ManipulationInertiaStarting event //Set the manipulations inertia values handler e.TranslationBehavior = new InertiaTranslationBehavior() • Define the behavior of the inertia { by specifying InitialVelocity = e.InitialVelocities.LinearVelocity, • Linear velocity DesiredDeceleration =… • Deceleration }; • Expansion velocity (used in e.ExpansionBehavior = new InertiaExpansionBehavior() pinch or spread) { • Angular velocity (used in InitialVelocity = e.InitialVelocities.ExpansionVelocity, rotation) DesiredDeceleration = … }; e.RotationBehavior = new InertiaRotationBehavior() { InitialVelocity = • Again, set Handled to true so other e.InitialVelocities.AngularVelocity, DesiredDeceleration = … handlers don’t process same event }; e.Handled = true;… Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 23
  • 24. Touch Event State Diagram Events begin with User Manipulation Touching the Image Starting Manipulation Manipulation Delta Manipulation Inertia Starting w/ Inertia Delta User finger is lifted from the screen User finger is touching the screen Manipulation Completed Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 24
  • 25. XAML: Handle inertia manipulation if (e.IsInertial) • Check if inertia is moving the { image across the grid //Get the containing element’s size Rect containingRect = … (e.ManipulationContainer).RenderSize); //Get the transformed element’s new //bounds Rect shapeBounds = rect.RenderTransform.TransformBounds (…); //If element falls out of bounds • If so, make sure image does not if (!containingRect.Contains(shapeBounds)) travel outside of the grid by { //Report boundary feedback calling the Complete method to e.ReportBoundaryFeedback(…); end the inertia //Stop any after inertia e.Complete(); } } … Copyright(C) 2012 Intel Corporation. All rights reserved. *Other brands and names are properties of their respective owners. 25
  • 26. References • Intel Ultrabook™ Community • Intel® Software Network – software.intel.com • Windows Development Reference – msdn.microsoft.com/en- us/library/windows/desktop/hh447209%28v=vs.85%2 9.aspx • WinRT API Reference – msdn.microsoft.com/en- us/library/windows/apps/br211377.aspx Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 26
  • 27. Q&A Sulamita Garcia – sulamita.garcia@intel.com Technical Marketing Engineer Twitter @sulagarcia Copyright© 2012, Intel Corporation. All rights reserved. *Other brands and names are the property of their respective owners 27