Md2010 jl-wp7-sl-dev
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Md2010 jl-wp7-sl-dev

  • 1,355 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,355
On Slideshare
1,354
From Embeds
1
Number of Embeds
1

Actions

Shares
Downloads
2
Comments
0
Likes
0

Embeds 1

http://silverlightguy.com 1

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1.
  • 2. Developing WP7 Appswith Silverlight
    José Luis Latorre
    Microsoft MVP, UX Specialist & Brainsiders CEO
    http://silverlightguy.com
  • 3.
  • 4. Generalni sponzori:
    Organizatori:
    Glavni sponzori:
    Generalni medijski sponzor:
    Sponzori:
    Medijski sponzori:
    Strateški partneri:
    Službena PR agencija:
  • 5. Application Framework details
    Windows Phone Frameworks
    Camera
    Device Integration
    Launchers & Choosers
    Windows Phone Controls
    PhoneApplicationPage
    PushNotification
    WebBrowserControl
    Sensors
    PhoneApplicationFrame
    Silverlight Presentation and Media
    XNA Frameworks for Games
    Controls
    Drawing
    IsolatedStorage
    Drawing
    GamerServices
    Navigation
    Shapes
    Markup
    Media
    Audio
    Media
    Graphics
    Content
    Input
    Application Object
    Common Base Class Library
    Diagnostics
    Reflection
    IO
    Runtime
    Resources
    Globalization
    Text
    Location
    Net
    Collections
    ComponentModel
    Configuration
    Security
    Threading
    ServiceModel
    Linq
  • 6. Whatis Silverlight?
    Powerful Development Platform
    Engaging, Interactive User Experiences
  • 7. Silverlighcapabilities
    Data
    Inputs
    Base Class Library (BCL)
    XAML
    UI Core
    Windows Communication Foundation
    Media
  • What Silverlight version do wehave?
    It is Silverlight 3 but adding:
    Performance tuning
    Input integration
    H/W media and sensor integration
    OS application model integration
    Relaxed sandbox constraints
  • 25. Whatmakes Silverlight so Special?
    M
    X
    A
    L
    eXtensible
    Application
    Markup
    Language
    XML
    Declarative Markup
    <Grid>
    <TextBlockFontSize="48" Text="Hello world" />
    </Grid>
  • 26. Whatmakes Silverlight so Special?
    Code
    XAML
    XAML maps to code
    Anything in XAML can be done in code
  • 27. SilverligthAppModel - What’s a XAP?
    myapp.xap
    Tools
    Common format for all Windows Phone apps & games
    Declarative, manifest-based installation
    Integrated into security model of phone
  • 28. Anoverview of a Silverlight appfor WP7
  • 29. Windows Phone application
    Application
    Frame
    Page 3
    Page 1
    Page 2
  • 30. Silverlight Controls
    Conformingto Metro DesignGuidelines.
    Consistent Look & Feel.
    Familiar toexisting Silverlight developers.
    TheyadapttothecurrentTheme.
  • 31. Output
  • 32. Media
    Media support
    H/W decode
    MediaStreamSource
    PlayReady DRM
    XNA framework sound effect API
    Supportspolyphony and looping
    MediaElement
    Only supports one MediaElement for page
    VideoBrush is not supported
  • 33. XNA for Windows Phone 7
    Using XNA audio capabilitiesisneeded
    UsingnamespaceMicrosoft.Xna.Framework.Audio
    TogetherwithSoundEffect and SoundEffectInstance
    AddingtheWavsoundfile as a contentelementtotheproject.
    // Audio
    SoundEffectsoundEffect;
    string soundName = "kaboom";
    // Loading and playing audio
    soundEffect = contentManager.Load<SoundEffect>(soundName); soundEffect.Play();
  • 34. Vibration
    Makesthephonevibrateduring a specificduration
    Useful for giving a tactile response totheuser.
    Tonotifyusers of anupdate.
    VibrateControllervc = VibrateController.Default;
    vc.Start(TimeSpan.FromSeconds(3));
    Microsoft.Devices.Sensors
  • 35. Input
  • 36. SIP I
    SIP Stands for Software Input Panel.
    TheTextBox Silverlight control integrateswith SIP
    SIP supportsaround 60 differentInputScopes:
  • 37. SIP II
    SIP can bepersonalizedwithseveralversions of thekeyboardthattheuser can selectbetween.
    Buttheapplication can also show theoptimumkeyboard.
    We use InputScopeto do that, for example:
    <TextBoxGrid.Row="1" Name="tbNombre" Text="">
    <TextBox.InputScope>
    <InputScope>
    <InputScopeNameNameValue="PersonalGivenName"></InputScopeName>
    </InputScope>
    </TextBox.InputScope>
    </TextBox>
  • 38. A Silverlight “Hello World” for WP7
    (link to demo)
  • 39. Accelerometer
    Measures force applied on each axis over time.
    +Y
    -Z
    -X
    +X
    +Z
    -Y
  • 40. Accelerometer I
    Getting data fromtheAccelerometer
    Add a refferencetoMicrosoft.Devices.Sensors
    Addthecorrespondingusing
    Declare the variable AccelerometerSensor
    Getaninstance of theAccelerometerSensor
    +Y
    usingMicrosoft.Devices.Sensors;
    -Z
    AccelerometerSensoraccelerometer;
    -X
    +X
    if (accelerometer == null)
    {
    sensor accelerometer = new AccelerometerSensor();
    }
    +Z
    -Y
  • 41. Accelerometer II
    +Y
    Getting data fromtheAccelerometer
    Suscribe totheeventReadingChanged
    Createtheeventhandler
    Initializetheaccelerometer
    accelSensor.ReadingChanged +=
    new EventHandler<AccelerometerReadingAsyncEventArgs>(AccelerometerReadingChanged);
    -Z
    publicvoidAccelerometerReadingChanged(objectsender, AccelerometerReadingAsyncEventArgs e)
    {
    accelReading.X = (float)e.Value.Value.X;
    accelReading.Y = (float)e.Value.Value.Y;
    accelReading.Z = (float)e.Value.Value.Z;
    }
    -X
    +X
    +Z
    -Y
    Accelsensor.Start();
  • 42. OS Integration
  • 43. ApplicationBar & ContextMenu
    The «Application Bar» is a control systemthatprovides a quickaddition of a tool bar for our WP7 application.
    ApartfromtheApplication Bar, applications can provideadditionaloptionslikeshowingoneor more menuelements.
    Microsoft.Phone.Shell
  • 44. ApplicationBar & ContextMenu
    By default wehave a sample XAML Code for quicklyenablingthisfeaturesonourapplications:
    <phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBarIsVisible="True" IsMenuEnabled="True">
    <shell:ApplicationBarIconButtonIconUri=“/appbar_button1.png" Text="Button 1"/>
    <shell:ApplicationBarIconButtonIconUri=“/appbar_button2.png" Text="Button 2"/>
    <shell:ApplicationBar.MenuItems>
    <shell:ApplicationBarMenuItemText="MenuItem 1"/>
    <shell:ApplicationBarMenuItemText="MenuItem 2"/>
    </shell:ApplicationBar.MenuItems>
    </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
  • 45. Navigation: Frame and Page
    Frame
    Isthetopmostcontainer control.
    PhoneApplicationFrameclass.
    Containsthe page control and sytsemelements, likeSystemTray, app bar, etc..
    Page
    Fillstheentirecontentregion of theFrame.
    Derives fromtheclassPhoneApplicationPage.
    Contains a title.
    Can haveitsownapplication bar.
  • 46. Orientation
    In VS2010 we can add a Landscape Page or a Portrait Page.
    TheonlydifferenceisonthepropertySupportedOrientationwhich can be:
    Portrait
    Landscape
    PortraitOrLandscape
    Wecan’tchangethe page orientation in code.
    Butwe can reacttoitschangesthroughtheOrientationChangedevent.
  • 47. Silverlight Toolkit
    (link to demo)
  • 48.
  • 49. jose@brainsiders.com - @joslat