SlideShare ist ein Scribd-Unternehmen logo
1 von 77
WP8 USING PHONE RESOURCES
1. Using the Contacts and Calendars in Windows Phone
2. Launchers and Choosers
3. The Windows Phone Camera
4. Taking still images
5. Manipulating the video stream
6. The Windows Phone Microphone
7. The Windows Phone Sensors
8. The Motion sensor
9. Video Content
FOLLOW US
Twitter : @chothanihitesh
Slideshare : http://www.slideshare.net/Chothani-Hitesh
Email : chothani.hitesh@gmail.com
Support : windows.chothani@live.com
LinkedIn : in.linkedin.com/pub/hiteshchothani/6b/311/2b8
W8 Publisher : AppStudios
WP Publisher : AppStudios
Website : www.appmobinfotech.com
READING CONTACTS AND
CALENDARS
YOUR OBLIGATIONS
 Before an application uses contact data in an application you must inform the user
and request their permission
 You must also ensure that your application manages contact data in a secure way
 It would be completely unacceptable for your application to make a copy of the
contact list and upload this or use it for spamming
APPLICATION CAPABILITIES
 Before an application can use the
Contacts and Appointments data on
a phone the user has to authorise
this capability
 Applications identify their
capabilities in the
WMAppManifest.xml file which is
part of the application project
 Visual Studio 2012 provides a GUI
which can be used to manage these
capabilities
 Not all the capabilities are enabled
when you make a new application
CONTACTS AND CALENDAR PROVIDERS
 A Windows Phone application can read contact and calendar information from the
different accounts
 Windows Live
 Exchange (Outlook, Google)
 Facebook
 Aggregated accounts (Twitter, LinkedIn etc)
 The precise abilities depend on the source of the information being used
DATA SOURCES
FINDING DATA SOURCES
 Each account has a property that allows an application to identify the source of that
account
 The StorageKind enumeration has values for all the account types available on Windows
Phone
READING CONTACTS
 This starts off a contacts load request
 This is not a filtered search, all contacts are returned
DISPLAYING CONTACTS
 This runs when the search returns
 It uses data binding to display the results on the screen in a ListBox
DATA BINDING
 This is the XAML that databinds the DisplayName property of the contact to a series of
items in a list
CONTACT DISPLAY
FILTERING SEARCHES
 By setting the FilterKind value on the search an application can apply a filter to the
results
 There are a number of filters available
 Display Name, Pinned to start, Email address, Phone number
 For advanced filtering a LINQ query could be used on the result enumeration
 Although this might be a slow operation
DISPLAYING APPOINTMENTS
 There is an analogous set of methods for finding appointments
 An application can search in a particular account type, for appointments in a particular
time range
 There is also a search method to search a particular account
 The reply is provided as a call back
 There are no appointments built into the emulator
CREATING A CONTACT
CREATING A CONTACT
 An application cannot create a contact without the user being aware this action is being
performed
 This ensures that the user is always aware of what is going on when they are using the program
 Applications can create their own custom contact store to store contact details for use in
that application
 This appears on the People Hub and in contact searches on that phone
 To create a contact we use a “Chooser” which will display a confirmation dialog and give
the user the option to create the contact or not
 The chooser is called asynchronously and will generate an event that tells the application
whether the action succeeded or not
LAUNCHERS AND CHOOSERS
 A Chooser is used when an application wants to perform a task and get a response from
the user
 Select a contact or image
 On completion of the choice the application is resumed
 A Launcher called when application wants to perform a task
 Visit a web page or place a phone call
 The user can return to the application via the navigation stack
 In either case the application is made dormant/tombstoned while the task completes
CREATING A CHOOSER
 This creates a chooser to display the save contact dialog
CHOOSER COMPLETION
 This method is called when the chooser returns
 Some choosers return the result of selection the user has made
 This chooser returns whether the user saved the contact or not
CUSTOM CONTACTS STORE
 It is only possible for an application to add contacts to any of the users’ configured accounts
by using the SaveContactTask
 An application can create a Custom Contacts store to which it can add contacts directly
without user confirmation
 Contacts added in this way will show up in the People Hub on the phone and also in
searches for contacts
 These contacts can also be linked with other contacts on the phone
 Your application can also add custom properties (for example passwords or additional user
data) to entries in the custom contacts store
CREATING A CUSTOM CONTACT
 This method creates a custom contact with a custom password property
 This will not cause a Chooser to be displayed, the contact is stored directly
USING CUSTOM CONTACTS
 An application can search through the custom
contacts that it has created
 Custom contacts created by an application can be
linked with other contacts on the phone
 They can also be created from vCard electronic
business cards
 If the user tries to edit a custom contact the phone
will offer to create a copy of the account and link it to
the custom one, as shown on the right
MAKE A CONTACT
OTHER SAVE TASKS
 There are a number of other ‘save’ Choosers available
 SaveEmailAddressTask
 Save an email address
 The address can be added to a contact
 SavePhoneNumberTask
 Save a phone number
 SaveRingtoneTask
 Save a sound file as a ringtone
LAUNCHERS VS CHOOSERS
 A Chooser allows the given action to return a result
 Often the result is an item that has been chosen
 Sometimes the result is a status report from an action that may succeed or fail
 The application can bind to an event which will be fired once the choice has been made or the action
performed
 The action may never be completed if the user goes off and does something else
 A Launcher causes a change of context into the target of the launch
 The current application is made dormant or tombstoned
 If the user returns to the application it will be Activated or Launched at that point
CHOOSER TASKS
LAUNCHER TASKS
CREATING AN APPOINTMENT WITH A
LAUNCHER (NEW IN WP8)
 This code creates a 1 hour appointment 2 hours into the future
 It will have a reminder set for 15 minutes before the event
CREATING AN APPOINTMENT
 When the appointment is created the launcher
runs in the same way as for an address book
entry
 The user can assign the appointment to a
particular calendar and save it
 Note that this is a launcher event
 There is no data returned from the task
 If your application wants to see if the appointment was
created it will have to go and look for it
 When the launcher completes the application is
Activated from Dormant or Tombstoned
LAUNCHING A BUILT-IN APP USING
LAUNCHURIASYNC (NEW IN WP8)
 As an alternative to the Launcher APIs, you can use the LaunchUriAsync method to
launch system applications
 Some built-in applications are *only* available by this technique
LAUNCHING BUILT-IN APPS
USE LAUNCHURIASYNC TO LAUNCH MANY OF THE BUILT-IN APPS
LAUNCHING BUILT-IN APPS (CONT)
ALARMS AND REMINDERS ON
WINDOWS PHONE 8
ALARMS AND REMINDERS
 Time-based, on-phone notifications
 Persist across reboots
 Adheres to user settings
 Consistent with phone UX
 These are displayed whether the application is running or not
 Reminder notifications can be deep linked to an application page
 Notifications can fire once, or repeatedly at configurable intervals
 Limit of 50 Alarms and Reminders at a time per application
ALARMS VS REMINDERS?
THE “EGG TIMER” APPLICATION
 This is a simple two page Silverlight application
 The user sets the time using the slider and then
presses the Start Timer button to create a
notification
 When the notification fires the “Egg Ready”
page is displayed if the user clicks through to
the application
CREATING A REMINDER
 This code creates a reminder and adds it as a scheduled service
 The value eggTime holds the length of the delay
 This code also sets the url of the page in the application
REMINDER HOUSEKEEPING
 Reminders are identified by name
 This code finds the “Egg Timer” reminder and then removes it from the scheduler
USING THE CAMERA
IN APPLICATION CAMERA
THE WINDOWS PHONE CAMERA
 There are a number of ways the camera can be used by an application
 The application can launch the CameraCaptureTask chooser to capture a photograph
 The application can use the PhotoCamera class to capture photos or stream video data
from the camera
 Can use this for product recognition or augmented reality
 Use the PhotoCaptureDevice class for advanced photo capture and
AudioVideoCaptureDevice for advanced video capture
 A real-time video processing application can be registered as a “Lens”
 It can be selected by the user from a menu of available lens types
 The Lens application will provides a viewfinder display and performs video processing on the signal from the
camera
CAPTURING A PHOTO
 This task launches the camera so that the user can take a picture
 The cameraTask_Completed event fires when the picture is taken
 The emulator will return an image containing a small block
CAPTURE COMPLETE
 When capture has been made, completed method is executed
 This version just displays the image on the screen
 You can access the photo stream data to save it
IN APPLICATION CAPTURE
 It is also possible to capture an image from within your application
 An application can also display a viewfinder
 The application can also access the video data directly and use this for augmented reality
or to create a customised viewfinder
 eg. Barcode scanners
 The PhotoCamera class provides camera control and access to the camera video screen
THE PHOTOCAMERA CLASS
 This creates a camera and binds a handler to the captured event
 The viewfinderBrush source is set to the camera
DISPLAYING THE VIEWFINDER
 This is the rectangle in the xaml for the camera viewfinder page
 This will display the viewfinder on the screen
 The source for the viewfinder brush is set to the camera
INITIATING THE CAPTURE
 This is the event handler for the photo button
 It asks the camera to take a picture
 The current camera settings are used for this
 You can override these (for example turn the flash on or off) by setting properties on the
camera instance
SAVING THE IMAGE
 This saves the image in the camera roll
DISPLAYING THE IMAGE
 This saves the image into a BitmapImage which is displayed on the screen in an <Image>
SAVING TO THE LOCAL FOLDER
 This saves the image in the local folder
FUNKY CAMERA
CREATING A LENS
 A Lens is a custom camera application which can be accessed
from within the camera application
 An application is flagged as a Lens application by setting a
flag in the manifest and providing icons that can be used to
browse for the Lens when the camera is in use
 I’ve created a FunkyCamera lens application which I have
registered in this way
CREATING A LENS APPLICATION
 This text must be added to the WMAppManifest.xml file for the application, just after the
<Tokens> section
 There is no GUI for this alteration, you have to edit the XML directly
ADDING THE LENS ICONS
 Three Icons are required, one for each Windows Phone screen size
 WVGA 173 × 173 AssetsLens.Screen-WVGA.png
 720p 259 × 259 AssetsLens.Screen-720p.png
 WXGA 277 × 277 AssetsLens.Screen-WXGA.png
 They are all placed in the Assets folder of the application
 Use a transparent background to match the Windows Phone color scheme
LENS STARTUP
 You can create a URI Mapper to direct the application to the page that implements the
viewfinder for the Lens
 This can use the string “Viewfinderlaunch” in the destination uri that is activated when the user selects the
lens application
 Alternatively, if the program only contains a single page this page is displayed
 If the user “backs out” of the lens application they will be returned to the camera
IMAGE PROCESSING IN A LENS
 The PhotoCamera class is used to provide access to the video stream
 This can be used by applications to perform image processing on the live data
 Augmented reality
 Scanning applications
 We are going to use it to make the funky camera display a funky image
FUNKY IMAGE PROCESSING
 This separates out the primaries and adds an offset to each
 It is called for each pixel in the image
STARTING THE CAMERA
 This creates the camera and the bitmap that will contain the image processed output
 It binds to the event fired when the camera is ready
STARTING THE CAMERA
 When the camera is ready we start the thread that will pump frames into our image
processor
 This will run alongside our application
GETTING THE IMAGE DATA
 This code grabs the preview buffer from the camera and processes it
DRAWING THE IMAGE DATA
 This code writes the processed pixels back to a writeable bitmap that is displayed on the
screen
CREATING AN AUTO-UPLOADER FOR
PHOTOS
 You can also create an application that has an auto-upload behaviour for pictures that the
user may take
 The upload behaviour is a “resource intensive” background task
 The application must set the extension shown above and display a settings page where the
user can set authentication and upload options
 This is a background process and therefore might not get to run
USING THE MICROPHONE
THE WINDOWS PHONE MICROPHONE
 The Windows Phone microphone can capture 16 bit audio
 Microphone input is managed as part of the XNA framework
 It is possible to record sound, process the audio and either store or replay it
 There is a complete example of how to do this on MSDN
WINDOWS PHONE 8 SENSORS
SENSORS AVAILABLE
 There are a number of different sensors:
 Accelerometer
 Compass
 Gyroscope
 Inclinometer
 Orientation
 All the sensors are used in the same way:
 They will fire an event when they have a reading
 Two APIs for managed code developers:
 Microsoft.Devices.Sensors (Windows Phone OS 7.1 API set)
 Windows.Devices.Sensors (Windows Phone Runtime)
THE WINDOWS RUNTIME SENSORS
LIBRARY
 The Windows Phone Runtime sensors APIs are compatible with sensor
usage in WinRT on Windows 8
 Accelerometer – returns G-force values with respect to the x, y, and z axes
 All phones have an accelerometer
 Inclinometer - returns pitch, roll, and yaw values that correspond to rotation angles
around the x, y, and z axes, respectively
 The inclinometer readings are derived from multiple sensors
 Gyrometer - returns angular velocity values with respect to the x, y, and z axes
 Compass - returns a heading with respect to True North and, possibly, Magnetic
North
 OrientationSensor - returns a rotation matrix and a Quaternion that can be used to
adjust the user's perspective in a game application
 Combines the data from the accelerometer, compass, and gyrometer – known as “Sensor Fusion”
DETERMINING SENSOR AVAILABILITY
 All the sensor classes have a GetDefault() method
 This method only returns values for hardware that has been integrated into
the computer by the manufacturer
 Returns null if the sensor is not available on that device
 All phones will have an accelerometer
STARTING AND STOPPING A SENSOR
 Application must set the report interval to a non-zero value prior to
registering an event handler or calling GetCurrentReading to activate it
 When finished with the sensor, set it to zero
 Check the MinimumReportInterval property
 Setting a value below the minimum supported interval will either trigger an exception
or have undefined results.
 Sensor driver will determine the actual report interval
USING THE SENSOR READINGCHANGED
EVENT
 Register the ReadingChanged event handler to obtain sensor readings
 Must set the ReportInterval property first
GETTING READINGS BY POLLING A
SENSOR
 An application can poll the sensor for the current reading as an alternative
to registering a ReadingChanged event handler
 The preferred alternative for an application that updates its user interface at a specific
frame rate
 Must still establish a desired ReportInterval before polling in order to
activate the sensor
VIDEO CONTENT
VIDEO ON THE PHONE
 An application can contain a single MediaElement that can play video
 The sample above plays a resource file that is part of the project containing
the application
 You can find a list of supported codecs here:
 http://msdn.microsoft.com/en-us/library/ff462087.aspx
STREAMING VIDEO ON THE PHONE
 If you want to stream from the internet, just replace the source file with a
url
 This implementation has the location hard coded into the XAML
 You can also do this under program control
CONTROLLING PLAYBACK
 The MediaElement exposes methods that can be used to control the media
playback
 An application can also determine the properties of the media stream
 To determine if it can be paused for example
SMOOTH STREAMING
 •Windows Phone also supports Smooth Streaming
 This is an adaptive streaming that manages the quality of the video signal in response
to the abilities of the network connection
 Playback quality is managed in real time to handle changes in network performance
during viewing
 It uses a server side plugin and client code on the viewing device
 You can download the viewing software here: http://smf.codeplex.com
Thank You

Weitere ähnliche Inhalte

Andere mochten auch

Overview do Windows Phone 7 Series
Overview do Windows Phone 7 SeriesOverview do Windows Phone 7 Series
Overview do Windows Phone 7 SeriesLuciano Condé
 
Windows phone 8 session 1
Windows phone 8 session 1Windows phone 8 session 1
Windows phone 8 session 1hitesh chothani
 
Sistemas Operacionais Multimidia Cap7 Tanenbaum
Sistemas Operacionais Multimidia   Cap7 TanenbaumSistemas Operacionais Multimidia   Cap7 Tanenbaum
Sistemas Operacionais Multimidia Cap7 Tanenbaumandfelipe
 
03 Sistemas Operacionais Linux
03   Sistemas Operacionais Linux03   Sistemas Operacionais Linux
03 Sistemas Operacionais LinuxMauro Duarte
 
Introdução a sistemas operacionais 002
Introdução a sistemas operacionais 002Introdução a sistemas operacionais 002
Introdução a sistemas operacionais 002ewerton333
 
Sistemas Operacionais - 05 - Sistemas Operacionais Microsoft
Sistemas Operacionais - 05 - Sistemas Operacionais MicrosoftSistemas Operacionais - 05 - Sistemas Operacionais Microsoft
Sistemas Operacionais - 05 - Sistemas Operacionais MicrosoftMauro Duarte
 
Primeiros passos Windows Phone - 3º Campo Grande Game Show
Primeiros passos Windows Phone - 3º Campo Grande Game ShowPrimeiros passos Windows Phone - 3º Campo Grande Game Show
Primeiros passos Windows Phone - 3º Campo Grande Game ShowLeandro Borges
 
ApresentaçãO2 Sistema Operacional
ApresentaçãO2  Sistema OperacionalApresentaçãO2  Sistema Operacional
ApresentaçãO2 Sistema OperacionalCláudia Costa
 

Andere mochten auch (8)

Overview do Windows Phone 7 Series
Overview do Windows Phone 7 SeriesOverview do Windows Phone 7 Series
Overview do Windows Phone 7 Series
 
Windows phone 8 session 1
Windows phone 8 session 1Windows phone 8 session 1
Windows phone 8 session 1
 
Sistemas Operacionais Multimidia Cap7 Tanenbaum
Sistemas Operacionais Multimidia   Cap7 TanenbaumSistemas Operacionais Multimidia   Cap7 Tanenbaum
Sistemas Operacionais Multimidia Cap7 Tanenbaum
 
03 Sistemas Operacionais Linux
03   Sistemas Operacionais Linux03   Sistemas Operacionais Linux
03 Sistemas Operacionais Linux
 
Introdução a sistemas operacionais 002
Introdução a sistemas operacionais 002Introdução a sistemas operacionais 002
Introdução a sistemas operacionais 002
 
Sistemas Operacionais - 05 - Sistemas Operacionais Microsoft
Sistemas Operacionais - 05 - Sistemas Operacionais MicrosoftSistemas Operacionais - 05 - Sistemas Operacionais Microsoft
Sistemas Operacionais - 05 - Sistemas Operacionais Microsoft
 
Primeiros passos Windows Phone - 3º Campo Grande Game Show
Primeiros passos Windows Phone - 3º Campo Grande Game ShowPrimeiros passos Windows Phone - 3º Campo Grande Game Show
Primeiros passos Windows Phone - 3º Campo Grande Game Show
 
ApresentaçãO2 Sistema Operacional
ApresentaçãO2  Sistema OperacionalApresentaçãO2  Sistema Operacional
ApresentaçãO2 Sistema Operacional
 

Ähnlich wie Windows phone 8 session 13

Windows phone 8 session 9
Windows phone 8 session 9Windows phone 8 session 9
Windows phone 8 session 9hitesh chothani
 
Windows Phone 8 - 10 Using Phone Resources
Windows Phone 8 - 10 Using Phone ResourcesWindows Phone 8 - 10 Using Phone Resources
Windows Phone 8 - 10 Using Phone ResourcesOliver Scheer
 
Build a Mobile App with Google Forms and AppSheet
Build a Mobile App with Google Forms and AppSheetBuild a Mobile App with Google Forms and AppSheet
Build a Mobile App with Google Forms and AppSheetAppSheet
 
Bcsf13a019_mcqs_ead
Bcsf13a019_mcqs_eadBcsf13a019_mcqs_ead
Bcsf13a019_mcqs_eadMarYam IqBal
 
Launchers and choosers
Launchers and choosersLaunchers and choosers
Launchers and choosersAmr Abulnaga
 
Achieving quality contraints
Achieving quality contraintsAchieving quality contraints
Achieving quality contraintsK Senthil Kumar
 
Design for charms & contracts
Design for charms & contractsDesign for charms & contracts
Design for charms & contractsMaria Nasioti
 
05 wp7 launchers and choosers
05 wp7   launchers and choosers05 wp7   launchers and choosers
05 wp7 launchers and choosersTao Wang
 
Guidelines for Android application design.pptx
Guidelines for Android application design.pptxGuidelines for Android application design.pptx
Guidelines for Android application design.pptxdebasish duarah
 
Sonico: OpenSocial Virality Guide
Sonico: OpenSocial Virality GuideSonico: OpenSocial Virality Guide
Sonico: OpenSocial Virality GuideAlejandro Sena
 
Program Description Basic User InterfaceThis program create.docx
Program Description Basic User InterfaceThis program create.docxProgram Description Basic User InterfaceThis program create.docx
Program Description Basic User InterfaceThis program create.docxwkyra78
 
m365_slides.pptx
m365_slides.pptxm365_slides.pptx
m365_slides.pptxadewad
 
etouches Introduces eMobile
etouches Introduces eMobileetouches Introduces eMobile
etouches Introduces eMobileSuzanne Carawan
 
How to integrate flurry in android
How to integrate flurry in androidHow to integrate flurry in android
How to integrate flurry in androidadityakumar2080
 
Mobile App Testing Checklist
Mobile App Testing ChecklistMobile App Testing Checklist
Mobile App Testing ChecklistManoj Lonar
 
Developing Application in WP7
Developing Application in WP7Developing Application in WP7
Developing Application in WP7Kunal Chowdhury
 
Jack borden jb471909_testflight
Jack borden jb471909_testflightJack borden jb471909_testflight
Jack borden jb471909_testflightjborden33
 
Latest proposal project info zakat
Latest proposal project info zakatLatest proposal project info zakat
Latest proposal project info zakatUmmi Zakiah
 
Mobile + cloud = heaven
Mobile + cloud = heavenMobile + cloud = heaven
Mobile + cloud = heavenX.commerce
 

Ähnlich wie Windows phone 8 session 13 (20)

Windows phone 8 session 9
Windows phone 8 session 9Windows phone 8 session 9
Windows phone 8 session 9
 
Windows Phone 8 - 10 Using Phone Resources
Windows Phone 8 - 10 Using Phone ResourcesWindows Phone 8 - 10 Using Phone Resources
Windows Phone 8 - 10 Using Phone Resources
 
Build a Mobile App with Google Forms and AppSheet
Build a Mobile App with Google Forms and AppSheetBuild a Mobile App with Google Forms and AppSheet
Build a Mobile App with Google Forms and AppSheet
 
Bcsf13a019_mcqs_ead
Bcsf13a019_mcqs_eadBcsf13a019_mcqs_ead
Bcsf13a019_mcqs_ead
 
Launchers and choosers
Launchers and choosersLaunchers and choosers
Launchers and choosers
 
Achieving quality contraints
Achieving quality contraintsAchieving quality contraints
Achieving quality contraints
 
Design for charms & contracts
Design for charms & contractsDesign for charms & contracts
Design for charms & contracts
 
05 wp7 launchers and choosers
05 wp7   launchers and choosers05 wp7   launchers and choosers
05 wp7 launchers and choosers
 
Guidelines for Android application design.pptx
Guidelines for Android application design.pptxGuidelines for Android application design.pptx
Guidelines for Android application design.pptx
 
Sonico: OpenSocial Virality Guide
Sonico: OpenSocial Virality GuideSonico: OpenSocial Virality Guide
Sonico: OpenSocial Virality Guide
 
Program Description Basic User InterfaceThis program create.docx
Program Description Basic User InterfaceThis program create.docxProgram Description Basic User InterfaceThis program create.docx
Program Description Basic User InterfaceThis program create.docx
 
m365_slides.pptx
m365_slides.pptxm365_slides.pptx
m365_slides.pptx
 
etouches Introduces eMobile
etouches Introduces eMobileetouches Introduces eMobile
etouches Introduces eMobile
 
How to integrate flurry in android
How to integrate flurry in androidHow to integrate flurry in android
How to integrate flurry in android
 
Mobile App Testing Checklist
Mobile App Testing ChecklistMobile App Testing Checklist
Mobile App Testing Checklist
 
Developing Application in WP7
Developing Application in WP7Developing Application in WP7
Developing Application in WP7
 
Building an app from scratch
Building an app from scratchBuilding an app from scratch
Building an app from scratch
 
Jack borden jb471909_testflight
Jack borden jb471909_testflightJack borden jb471909_testflight
Jack borden jb471909_testflight
 
Latest proposal project info zakat
Latest proposal project info zakatLatest proposal project info zakat
Latest proposal project info zakat
 
Mobile + cloud = heaven
Mobile + cloud = heavenMobile + cloud = heaven
Mobile + cloud = heaven
 

Mehr von hitesh chothani

Windows phone 8 session 11
Windows phone 8 session 11Windows phone 8 session 11
Windows phone 8 session 11hitesh chothani
 
Windows phone 8 session 10
Windows phone 8 session 10Windows phone 8 session 10
Windows phone 8 session 10hitesh chothani
 
Windows phone 8 session 8
Windows phone 8 session 8Windows phone 8 session 8
Windows phone 8 session 8hitesh chothani
 
Windows phone 8 session 7
Windows phone 8 session 7Windows phone 8 session 7
Windows phone 8 session 7hitesh chothani
 
Windows phone 8 session 6
Windows phone 8 session 6Windows phone 8 session 6
Windows phone 8 session 6hitesh chothani
 
Windows phone 8 session 5
Windows phone 8 session 5Windows phone 8 session 5
Windows phone 8 session 5hitesh chothani
 
Windows phone 8 session 4
Windows phone 8 session 4Windows phone 8 session 4
Windows phone 8 session 4hitesh chothani
 
Windows phone 8 session 3
Windows phone 8 session 3Windows phone 8 session 3
Windows phone 8 session 3hitesh chothani
 
Windows phone 8 session 2
Windows phone 8 session 2Windows phone 8 session 2
Windows phone 8 session 2hitesh chothani
 

Mehr von hitesh chothani (9)

Windows phone 8 session 11
Windows phone 8 session 11Windows phone 8 session 11
Windows phone 8 session 11
 
Windows phone 8 session 10
Windows phone 8 session 10Windows phone 8 session 10
Windows phone 8 session 10
 
Windows phone 8 session 8
Windows phone 8 session 8Windows phone 8 session 8
Windows phone 8 session 8
 
Windows phone 8 session 7
Windows phone 8 session 7Windows phone 8 session 7
Windows phone 8 session 7
 
Windows phone 8 session 6
Windows phone 8 session 6Windows phone 8 session 6
Windows phone 8 session 6
 
Windows phone 8 session 5
Windows phone 8 session 5Windows phone 8 session 5
Windows phone 8 session 5
 
Windows phone 8 session 4
Windows phone 8 session 4Windows phone 8 session 4
Windows phone 8 session 4
 
Windows phone 8 session 3
Windows phone 8 session 3Windows phone 8 session 3
Windows phone 8 session 3
 
Windows phone 8 session 2
Windows phone 8 session 2Windows phone 8 session 2
Windows phone 8 session 2
 

Kürzlich hochgeladen

5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...CaraSkikne1
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?TechSoup
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfTechSoup
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationMJDuyan
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfMohonDas
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxKatherine Villaluna
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesCeline George
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17Celine George
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfYu Kanazawa / Osaka University
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxKatherine Villaluna
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice documentXsasf Sfdfasd
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.raviapr7
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and stepobaje godwin sunday
 

Kürzlich hochgeladen (20)

5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...5 charts on South Africa as a source country for international student recrui...
5 charts on South Africa as a source country for international student recrui...
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?What is the Future of QuickBooks DeskTop?
What is the Future of QuickBooks DeskTop?
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdfMaximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
Maximizing Impact_ Nonprofit Website Planning, Budgeting, and Design.pdf
 
UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024UKCGE Parental Leave Discussion March 2024
UKCGE Parental Leave Discussion March 2024
 
Benefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive EducationBenefits & Challenges of Inclusive Education
Benefits & Challenges of Inclusive Education
 
HED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdfHED Office Sohayok Exam Question Solution 2023.pdf
HED Office Sohayok Exam Question Solution 2023.pdf
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
 
How to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 SalesHow to Manage Cross-Selling in Odoo 17 Sales
How to Manage Cross-Selling in Odoo 17 Sales
 
In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17How to Show Error_Warning Messages in Odoo 17
How to Show Error_Warning Messages in Odoo 17
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdfP4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
P4C x ELT = P4ELT: Its Theoretical Background (Kanazawa, 2024 March).pdf
 
Practical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptxPractical Research 1 Lesson 9 Scope and delimitation.pptx
Practical Research 1 Lesson 9 Scope and delimitation.pptx
 
The Singapore Teaching Practice document
The Singapore Teaching Practice documentThe Singapore Teaching Practice document
The Singapore Teaching Practice document
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.Drug Information Services- DIC and Sources.
Drug Information Services- DIC and Sources.
 
General views of Histopathology and step
General views of Histopathology and stepGeneral views of Histopathology and step
General views of Histopathology and step
 

Windows phone 8 session 13

  • 1. WP8 USING PHONE RESOURCES 1. Using the Contacts and Calendars in Windows Phone 2. Launchers and Choosers 3. The Windows Phone Camera 4. Taking still images 5. Manipulating the video stream 6. The Windows Phone Microphone 7. The Windows Phone Sensors 8. The Motion sensor 9. Video Content
  • 2. FOLLOW US Twitter : @chothanihitesh Slideshare : http://www.slideshare.net/Chothani-Hitesh Email : chothani.hitesh@gmail.com Support : windows.chothani@live.com LinkedIn : in.linkedin.com/pub/hiteshchothani/6b/311/2b8 W8 Publisher : AppStudios WP Publisher : AppStudios Website : www.appmobinfotech.com
  • 4. YOUR OBLIGATIONS  Before an application uses contact data in an application you must inform the user and request their permission  You must also ensure that your application manages contact data in a secure way  It would be completely unacceptable for your application to make a copy of the contact list and upload this or use it for spamming
  • 5. APPLICATION CAPABILITIES  Before an application can use the Contacts and Appointments data on a phone the user has to authorise this capability  Applications identify their capabilities in the WMAppManifest.xml file which is part of the application project  Visual Studio 2012 provides a GUI which can be used to manage these capabilities  Not all the capabilities are enabled when you make a new application
  • 6. CONTACTS AND CALENDAR PROVIDERS  A Windows Phone application can read contact and calendar information from the different accounts  Windows Live  Exchange (Outlook, Google)  Facebook  Aggregated accounts (Twitter, LinkedIn etc)  The precise abilities depend on the source of the information being used
  • 8. FINDING DATA SOURCES  Each account has a property that allows an application to identify the source of that account  The StorageKind enumeration has values for all the account types available on Windows Phone
  • 9. READING CONTACTS  This starts off a contacts load request  This is not a filtered search, all contacts are returned
  • 10. DISPLAYING CONTACTS  This runs when the search returns  It uses data binding to display the results on the screen in a ListBox
  • 11. DATA BINDING  This is the XAML that databinds the DisplayName property of the contact to a series of items in a list
  • 13. FILTERING SEARCHES  By setting the FilterKind value on the search an application can apply a filter to the results  There are a number of filters available  Display Name, Pinned to start, Email address, Phone number  For advanced filtering a LINQ query could be used on the result enumeration  Although this might be a slow operation
  • 14. DISPLAYING APPOINTMENTS  There is an analogous set of methods for finding appointments  An application can search in a particular account type, for appointments in a particular time range  There is also a search method to search a particular account  The reply is provided as a call back  There are no appointments built into the emulator
  • 16. CREATING A CONTACT  An application cannot create a contact without the user being aware this action is being performed  This ensures that the user is always aware of what is going on when they are using the program  Applications can create their own custom contact store to store contact details for use in that application  This appears on the People Hub and in contact searches on that phone  To create a contact we use a “Chooser” which will display a confirmation dialog and give the user the option to create the contact or not  The chooser is called asynchronously and will generate an event that tells the application whether the action succeeded or not
  • 17. LAUNCHERS AND CHOOSERS  A Chooser is used when an application wants to perform a task and get a response from the user  Select a contact or image  On completion of the choice the application is resumed  A Launcher called when application wants to perform a task  Visit a web page or place a phone call  The user can return to the application via the navigation stack  In either case the application is made dormant/tombstoned while the task completes
  • 18. CREATING A CHOOSER  This creates a chooser to display the save contact dialog
  • 19. CHOOSER COMPLETION  This method is called when the chooser returns  Some choosers return the result of selection the user has made  This chooser returns whether the user saved the contact or not
  • 20. CUSTOM CONTACTS STORE  It is only possible for an application to add contacts to any of the users’ configured accounts by using the SaveContactTask  An application can create a Custom Contacts store to which it can add contacts directly without user confirmation  Contacts added in this way will show up in the People Hub on the phone and also in searches for contacts  These contacts can also be linked with other contacts on the phone  Your application can also add custom properties (for example passwords or additional user data) to entries in the custom contacts store
  • 21. CREATING A CUSTOM CONTACT  This method creates a custom contact with a custom password property  This will not cause a Chooser to be displayed, the contact is stored directly
  • 22. USING CUSTOM CONTACTS  An application can search through the custom contacts that it has created  Custom contacts created by an application can be linked with other contacts on the phone  They can also be created from vCard electronic business cards  If the user tries to edit a custom contact the phone will offer to create a copy of the account and link it to the custom one, as shown on the right
  • 24. OTHER SAVE TASKS  There are a number of other ‘save’ Choosers available  SaveEmailAddressTask  Save an email address  The address can be added to a contact  SavePhoneNumberTask  Save a phone number  SaveRingtoneTask  Save a sound file as a ringtone
  • 25. LAUNCHERS VS CHOOSERS  A Chooser allows the given action to return a result  Often the result is an item that has been chosen  Sometimes the result is a status report from an action that may succeed or fail  The application can bind to an event which will be fired once the choice has been made or the action performed  The action may never be completed if the user goes off and does something else  A Launcher causes a change of context into the target of the launch  The current application is made dormant or tombstoned  If the user returns to the application it will be Activated or Launched at that point
  • 28. CREATING AN APPOINTMENT WITH A LAUNCHER (NEW IN WP8)  This code creates a 1 hour appointment 2 hours into the future  It will have a reminder set for 15 minutes before the event
  • 29. CREATING AN APPOINTMENT  When the appointment is created the launcher runs in the same way as for an address book entry  The user can assign the appointment to a particular calendar and save it  Note that this is a launcher event  There is no data returned from the task  If your application wants to see if the appointment was created it will have to go and look for it  When the launcher completes the application is Activated from Dormant or Tombstoned
  • 30. LAUNCHING A BUILT-IN APP USING LAUNCHURIASYNC (NEW IN WP8)  As an alternative to the Launcher APIs, you can use the LaunchUriAsync method to launch system applications  Some built-in applications are *only* available by this technique
  • 31. LAUNCHING BUILT-IN APPS USE LAUNCHURIASYNC TO LAUNCH MANY OF THE BUILT-IN APPS
  • 33. ALARMS AND REMINDERS ON WINDOWS PHONE 8
  • 34. ALARMS AND REMINDERS  Time-based, on-phone notifications  Persist across reboots  Adheres to user settings  Consistent with phone UX  These are displayed whether the application is running or not  Reminder notifications can be deep linked to an application page  Notifications can fire once, or repeatedly at configurable intervals  Limit of 50 Alarms and Reminders at a time per application
  • 36. THE “EGG TIMER” APPLICATION  This is a simple two page Silverlight application  The user sets the time using the slider and then presses the Start Timer button to create a notification  When the notification fires the “Egg Ready” page is displayed if the user clicks through to the application
  • 37. CREATING A REMINDER  This code creates a reminder and adds it as a scheduled service  The value eggTime holds the length of the delay  This code also sets the url of the page in the application
  • 38. REMINDER HOUSEKEEPING  Reminders are identified by name  This code finds the “Egg Timer” reminder and then removes it from the scheduler
  • 41. THE WINDOWS PHONE CAMERA  There are a number of ways the camera can be used by an application  The application can launch the CameraCaptureTask chooser to capture a photograph  The application can use the PhotoCamera class to capture photos or stream video data from the camera  Can use this for product recognition or augmented reality  Use the PhotoCaptureDevice class for advanced photo capture and AudioVideoCaptureDevice for advanced video capture  A real-time video processing application can be registered as a “Lens”  It can be selected by the user from a menu of available lens types  The Lens application will provides a viewfinder display and performs video processing on the signal from the camera
  • 42. CAPTURING A PHOTO  This task launches the camera so that the user can take a picture  The cameraTask_Completed event fires when the picture is taken  The emulator will return an image containing a small block
  • 43. CAPTURE COMPLETE  When capture has been made, completed method is executed  This version just displays the image on the screen  You can access the photo stream data to save it
  • 44. IN APPLICATION CAPTURE  It is also possible to capture an image from within your application  An application can also display a viewfinder  The application can also access the video data directly and use this for augmented reality or to create a customised viewfinder  eg. Barcode scanners  The PhotoCamera class provides camera control and access to the camera video screen
  • 45. THE PHOTOCAMERA CLASS  This creates a camera and binds a handler to the captured event  The viewfinderBrush source is set to the camera
  • 46. DISPLAYING THE VIEWFINDER  This is the rectangle in the xaml for the camera viewfinder page  This will display the viewfinder on the screen  The source for the viewfinder brush is set to the camera
  • 47. INITIATING THE CAPTURE  This is the event handler for the photo button  It asks the camera to take a picture  The current camera settings are used for this  You can override these (for example turn the flash on or off) by setting properties on the camera instance
  • 48. SAVING THE IMAGE  This saves the image in the camera roll
  • 49. DISPLAYING THE IMAGE  This saves the image into a BitmapImage which is displayed on the screen in an <Image>
  • 50. SAVING TO THE LOCAL FOLDER  This saves the image in the local folder
  • 52. CREATING A LENS  A Lens is a custom camera application which can be accessed from within the camera application  An application is flagged as a Lens application by setting a flag in the manifest and providing icons that can be used to browse for the Lens when the camera is in use  I’ve created a FunkyCamera lens application which I have registered in this way
  • 53. CREATING A LENS APPLICATION  This text must be added to the WMAppManifest.xml file for the application, just after the <Tokens> section  There is no GUI for this alteration, you have to edit the XML directly
  • 54. ADDING THE LENS ICONS  Three Icons are required, one for each Windows Phone screen size  WVGA 173 × 173 AssetsLens.Screen-WVGA.png  720p 259 × 259 AssetsLens.Screen-720p.png  WXGA 277 × 277 AssetsLens.Screen-WXGA.png  They are all placed in the Assets folder of the application  Use a transparent background to match the Windows Phone color scheme
  • 55. LENS STARTUP  You can create a URI Mapper to direct the application to the page that implements the viewfinder for the Lens  This can use the string “Viewfinderlaunch” in the destination uri that is activated when the user selects the lens application  Alternatively, if the program only contains a single page this page is displayed  If the user “backs out” of the lens application they will be returned to the camera
  • 56. IMAGE PROCESSING IN A LENS  The PhotoCamera class is used to provide access to the video stream  This can be used by applications to perform image processing on the live data  Augmented reality  Scanning applications  We are going to use it to make the funky camera display a funky image
  • 57. FUNKY IMAGE PROCESSING  This separates out the primaries and adds an offset to each  It is called for each pixel in the image
  • 58. STARTING THE CAMERA  This creates the camera and the bitmap that will contain the image processed output  It binds to the event fired when the camera is ready
  • 59. STARTING THE CAMERA  When the camera is ready we start the thread that will pump frames into our image processor  This will run alongside our application
  • 60. GETTING THE IMAGE DATA  This code grabs the preview buffer from the camera and processes it
  • 61. DRAWING THE IMAGE DATA  This code writes the processed pixels back to a writeable bitmap that is displayed on the screen
  • 62. CREATING AN AUTO-UPLOADER FOR PHOTOS  You can also create an application that has an auto-upload behaviour for pictures that the user may take  The upload behaviour is a “resource intensive” background task  The application must set the extension shown above and display a settings page where the user can set authentication and upload options  This is a background process and therefore might not get to run
  • 64. THE WINDOWS PHONE MICROPHONE  The Windows Phone microphone can capture 16 bit audio  Microphone input is managed as part of the XNA framework  It is possible to record sound, process the audio and either store or replay it  There is a complete example of how to do this on MSDN
  • 65. WINDOWS PHONE 8 SENSORS
  • 66. SENSORS AVAILABLE  There are a number of different sensors:  Accelerometer  Compass  Gyroscope  Inclinometer  Orientation  All the sensors are used in the same way:  They will fire an event when they have a reading  Two APIs for managed code developers:  Microsoft.Devices.Sensors (Windows Phone OS 7.1 API set)  Windows.Devices.Sensors (Windows Phone Runtime)
  • 67. THE WINDOWS RUNTIME SENSORS LIBRARY  The Windows Phone Runtime sensors APIs are compatible with sensor usage in WinRT on Windows 8  Accelerometer – returns G-force values with respect to the x, y, and z axes  All phones have an accelerometer  Inclinometer - returns pitch, roll, and yaw values that correspond to rotation angles around the x, y, and z axes, respectively  The inclinometer readings are derived from multiple sensors  Gyrometer - returns angular velocity values with respect to the x, y, and z axes  Compass - returns a heading with respect to True North and, possibly, Magnetic North  OrientationSensor - returns a rotation matrix and a Quaternion that can be used to adjust the user's perspective in a game application  Combines the data from the accelerometer, compass, and gyrometer – known as “Sensor Fusion”
  • 68. DETERMINING SENSOR AVAILABILITY  All the sensor classes have a GetDefault() method  This method only returns values for hardware that has been integrated into the computer by the manufacturer  Returns null if the sensor is not available on that device  All phones will have an accelerometer
  • 69. STARTING AND STOPPING A SENSOR  Application must set the report interval to a non-zero value prior to registering an event handler or calling GetCurrentReading to activate it  When finished with the sensor, set it to zero  Check the MinimumReportInterval property  Setting a value below the minimum supported interval will either trigger an exception or have undefined results.  Sensor driver will determine the actual report interval
  • 70. USING THE SENSOR READINGCHANGED EVENT  Register the ReadingChanged event handler to obtain sensor readings  Must set the ReportInterval property first
  • 71. GETTING READINGS BY POLLING A SENSOR  An application can poll the sensor for the current reading as an alternative to registering a ReadingChanged event handler  The preferred alternative for an application that updates its user interface at a specific frame rate  Must still establish a desired ReportInterval before polling in order to activate the sensor
  • 73. VIDEO ON THE PHONE  An application can contain a single MediaElement that can play video  The sample above plays a resource file that is part of the project containing the application  You can find a list of supported codecs here:  http://msdn.microsoft.com/en-us/library/ff462087.aspx
  • 74. STREAMING VIDEO ON THE PHONE  If you want to stream from the internet, just replace the source file with a url  This implementation has the location hard coded into the XAML  You can also do this under program control
  • 75. CONTROLLING PLAYBACK  The MediaElement exposes methods that can be used to control the media playback  An application can also determine the properties of the media stream  To determine if it can be paused for example
  • 76. SMOOTH STREAMING  •Windows Phone also supports Smooth Streaming  This is an adaptive streaming that manages the quality of the video signal in response to the abilities of the network connection  Playback quality is managed in real time to handle changes in network performance during viewing  It uses a server side plugin and client code on the viewing device  You can download the viewing software here: http://smf.codeplex.com