Windows Phone 7       Windows Phone 7 overview                           Soumow Atitallah                                 ...
Windows Phone 7                  Introduction                                 2
Windows Phone 7IntroductionA bit of history…                    Begining of major                    WM Update :          ...
Windows Phone 7IntroductionA bit of history…                    Now                     Fall 2011 : Release of Mango      ...
Windows Phone 7IntroductionThe break point Windows Phone 7 has :  No Retro-compatibility with Windows   Mobile  Based on...
Windows Phone 7IntroductionThe interface : Metro UI                           Metro UI                                    ...
Windows Phone 7Introduction Windows            Common                                   Consistent   Quality  Phone       ...
Windows Phone 7Introduction : Original hardware requirements                                           Touch              ...
Windows Phone 7Introduction : Developement technologies User interfaces in XAML                   High performance game ...
Windows Phone 7Introduction           Applications                                                            Your App UI ...
Windows Phone 7Introduction : App Model ConceptsApplicationUniquely identifiable,licensable and serviceablesoftware produc...
Windows Phone 7Introduction : Deployement and distribution process   Develop            Submit                     Certify...
Windows Phone 7Introduction : Developement tools                                                                         w...
Windows Phone 7Basics : Controls  Some of the controls :     Pivot     Panorama     Bing maps     DatePickers     Tim...
Windows Phone 7                  Tasks                          18
Windows Phone 7Some of the Tasks    AddressChooserTask    BingMapsDirectionsTask    BingMapsTask    ConnectionSettingsTask...
Windows Phone 7Tasks : AddressChooserTask                             AddressChooserTask addressChooserTask;              ...
Windows Phone 7Tasks : BingMapsDirectionsTask                BingMapsDirectionsTask bingMapsDirectionsTask = new BingMapsD...
Windows Phone 7Tasks : BingMapsTask                       BingMapsTask bingMapsTask = new BingMapsTask();                 ...
Windows Phone 7Tasks : ConnectionSettingsTask                                 ConnectionSettingsTask connectionSettingsTas...
Windows Phone 7Tasks : GameInviteTask                         GameInviteTask gameInviteTask;                         gameI...
Windows Phone 7Tasks : SaveContactTask                          SaveContactTask saveContactTask;                          ...
Windows Phone 7           Company              Gets or sets the name of the company associated with the contact.          ...
Windows Phone 7Tasks : SaveRingtoneTask                           try {                                   saveRingtoneChoo...
Windows Phone 7Tasks : ShareLinkTask   ShareLinkTask shareLinkTask = new ShareLinkTask();   shareLinkTask.Title = "Code Sa...
Windows Phone 7     Live Tiles & Push Notifications                                       29
Windows Phone 7Live Tiles                  Live Tiles allow content on a                  tile to be updated and          ...
Windows Phone 7Creating a tile   ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative),             new StandardTil...
Windows Phone 7Update/Deleting tiles   Tiles can expire or need updating                                Enumerate the tile...
Windows Phone 7Push Notifications                      3 Types of Push                       Notifications                ...
Windows Phone 7Push Notifications : Toast Notifications   Title. A boldface string that displays immediately after the app...
Windows Phone 7                  Multitasking                                 35
Windows Phone 7              Fast App switching                                   36
Windows Phone 7Application Lifecycle Pre-Mango                                     Running                        Activate...
Windows Phone 7Application Lifecycle in Mango                                     Running      Restore       state        ...
Windows Phone 7Application Lifecycle in Mango             Launch Event                 private void Application_Launching(...
Windows Phone 7             Background Agents                                 40
Windows Phone 7What are background agents? Background Agents are a seperate project from the  application you are creatin...
Windows Phone 7What can/can’t you do with Background Agents                        Allowed                        Not Allo...
Windows Phone 7Background Agents                     Background Transfer Service                     Background Audio   ...
Windows Phone 7Background Agents  Background Agents in Mango take the form of a separate assembly, which gets linked  in y...
Windows Phone 7             Background Agents          Background Transfer Service                                        45
Windows Phone 7Background Agents : Background Transfer Service Start in foreground, complete in background, even if  app ...
Windows Phone 7Background Agents : Background Transfer Service                                                  47
Windows Phone 7             Background Agents                  ScheduledTask Agent                                        48
Windows Phone 7Background Agents : ScheduledTask AgentIt is possible to have in Windows Phone 7 to execute codeas a planne...
Windows Phone 7Background Agents : ScheduledTask AgentLimitations:    Memory 5 Mo    Expiration : 2 Weeks    Restrained...
Windows Phone 7Background Agents : ScheduledTask AgentMicrosoft.Phone.Scheduler.PeriodicTask     PeriodicTask periodicTask...
Windows Phone 7Background Agents : ScheduledTask AgentThen create a class that inherits of ScheduledTaskAgent and override...
Windows Phone 7     Using APIs, Camera & Sensors                                    53
Windows Phone 7                  Sockets                            54
Windows Phone 7SocketsWindows Phone provides the programming interface needed to create and use TCP and UDP sockets. You c...
Windows Phone 7Socketsusing System.Net.Sockets; public string Connect(string hostName, int portNumber) {      DnsEndPoint ...
Windows Phone 7              Contacts/Calendar                                  57
Windows Phone 7Contacts/CalendarIn Windows Phone, you can now access the user information asynchrously, and even better yo...
Windows Phone 7Contacts/Calendarusing Microsoft.Phone.UserData;   Get appoinments using Linq:          void Appointments_S...
Windows Phone 7                  Media                          60
Windows Phone 7MediaYou can use the following features to consume media in a Windows Phone application:   Use the MediaPl...
Windows Phone 7Media : MediaElement      <MediaElement Name="mediaElement1" Source="http://mschannel9.vo.msecnd.net/o9/mix...
Windows Phone 7Media : Integration with the music hub                                         63
Windows Phone 7Media : Integration with the music hubYour Music + Videos Hub application must conform to the Application C...
Windows Phone 7 Media : Integration with the music hubUpdating the now playing Tile of the history List                   ...
Windows Phone 7                  Camera API                               66
Windows Phone 7Application Lifecycle Pre-MangoWindows Phone supports programmatic access to the camera on a device, offeri...
Windows Phone 7Camera API                  68
Windows Phone 7Camera API      To use a camera in your Windows Phone application, you must add the      camera capability ...
Windows Phone 7                  Conclusion                               70
Any questions ?                  71
Upcoming SlideShare
Loading in …5
×

Windows phone 7 overview

1,395 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,395
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
39
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Windows phone 7 overview

  1. 1. Windows Phone 7 Windows Phone 7 overview Soumow Atitallah 1
  2. 2. Windows Phone 7 Introduction 2
  3. 3. Windows Phone 7IntroductionA bit of history… Begining of major WM Update : « Photom » 2000 2005 2009 2010 First version Windows Windows Windows of Pocket PC Mobile 5 Phone 6.5 Phone 7 Usage of the name Windows Mobile Windows Zune HD Mobile 6 2003 2007 2009 3
  4. 4. Windows Phone 7IntroductionA bit of history… Now Fall 2011 : Release of Mango 4
  5. 5. Windows Phone 7IntroductionThe break point Windows Phone 7 has :  No Retro-compatibility with Windows Mobile  Based on Windows CE 6  New Interface based-on Metro UI  Hardware requirements  Good-bye Stylus ! 5
  6. 6. Windows Phone 7IntroductionThe interface : Metro UI Metro UI 6
  7. 7. Windows Phone 7Introduction Windows Common Consistent Quality Phone Hardware Platform Focus Hardware Elements Consistent set of hardware capabilities defined by Microsoft One resolution at launch Second resolution added later Same touch input Consistent processor / GPU Same available RAM Optional keyboard 7
  8. 8. Windows Phone 7Introduction : Original hardware requirements Touch 4 points of contacts Sensors A-GPS, Accelerometer, Luminosity, … APN 5 Megapixels minimum, flash Multimedia Codecs, Smooth Streaming Memory 256 Mo RAM minimum, 8Go of flash memory minimum GPU DirectX CPU 1GHz or more Buttons | Back, Start, Search 8
  9. 9. Windows Phone 7Introduction : Developement technologies User interfaces in XAML  High performance game framework Easy & quick to create rich visuel  Rapid creation of multi-screen 2D & 3D applications games Metro-UI themed controls  Rich content pipeline 500 000 developers spanning Windows  Mature, robust, widely adopted & Web spanning Xbox 360, Windows & Zune. 11
  10. 10. Windows Phone 7Introduction Applications Your App UI and logic Frameworks Silverlight XNA HTML/JavaScript CLR App Model UI Model Cloud Integration Xbox LIVE App management Shell frame Bing Licensing Session manager Location Chamber isolation Direct3D Push notifications Software updates Compositor Windows Live ID Kernel Hardware BSP Security Networking A-GPS AccelerometerCompass Light Proximity Storage Media Wi-Fi Radio Graphics Hardware Foundation 12
  11. 11. Windows Phone 7Introduction : App Model ConceptsApplicationUniquely identifiable,licensable and serviceablesoftware product packagedas a XAPApplication DeploymentSteps include Ingestion,Certification and Signing Windows Phone MarketplaceApplication licenseCrypto-verifiable objectissued to grant rights to Windows Phonean application Marketplace 13
  12. 12. Windows Phone 7Introduction : Deployement and distribution process Develop Submit Certify & Debug & Validate & Sign Windows Phone Application Deployment Marketplace Service 14
  13. 13. Windows Phone 7Introduction : Developement tools w/ Windows Phone SDK OR Third party IDEYou can also use Visual studio 2010 Express Edition for Windows PhoneSDK Available at : http://developer.windowsphone.com/ 15
  14. 14. Windows Phone 7Basics : Controls Some of the controls :  Pivot  Panorama  Bing maps  DatePickers  Time Pickers  …. And more in the SL toolkit 17
  15. 15. Windows Phone 7 Tasks 18
  16. 16. Windows Phone 7Some of the Tasks AddressChooserTask BingMapsDirectionsTask BingMapsTask ConnectionSettingsTask GameInviteTask PhoneCallTask SmsComposeTasks WebBrowserTask SaveContactTask SaveRingtoneTask ShareLinkTask ShareStatusTask 19
  17. 17. Windows Phone 7Tasks : AddressChooserTask AddressChooserTask addressChooserTask; addressChooserTask = new AddressChooserTask(); addressChooserTask.Completed += new EventHandler<AddressResult>(addressChooserTask_Completed); try { addressChooserTask.Show(); } catch (System.InvalidOperationException ex) { MessageBox.Show("An error occurred."); } void addressChooserTask_Completed(object sender, AddressResult e) { if (e.TaskResult == TaskResult.OK) { MessageBox.Show("The address for " + e.DisplayName + " is " + e.Address); } } 20
  18. 18. Windows Phone 7Tasks : BingMapsDirectionsTask BingMapsDirectionsTask bingMapsDirectionsTask = new BingMapsDirectionsTask(); // You can specify a label and a geocoordinate for the end point. // GeoCoordinate spaceNeedleLocation = new GeoCoordinate(47.6204,-122.3493); // LabeledMapLocation spaceNeedleLML = new LabeledMapLocation("Space Needle", spaceNeedleLocation); // If you set the geocoordinate parameter to null, the label parameter is used as a search term. LabeledMapLocation spaceNeedleLML = new LabeledMapLocation("Space Needle", null); bingMapsDirectionsTask.End = spaceNeedleLML; // If bingMapsDirectionsTask.Start is not set, the users current location is used as the start point. bingMapsDirectionsTask.Show(); 21
  19. 19. Windows Phone 7Tasks : BingMapsTask BingMapsTask bingMapsTask = new BingMapsTask(); //Omit the Center property to use the users current location. //bingMapsTask.Center = new GeoCoordinate(47.6204, -122.3493); bingMapsTask.SearchTerm = "coffee"; bingMapsTask.ZoomLevel = 2; bingMapsTask.Show(); 22
  20. 20. Windows Phone 7Tasks : ConnectionSettingsTask ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask(); connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.WiFi; connectionSettingsTask.Show(); 23
  21. 21. Windows Phone 7Tasks : GameInviteTask GameInviteTask gameInviteTask; gameInviteTask = new GameInviteTask(); gameInviteTask.Completed += new EventHandler<TaskEventArgs>(gameInviteTask_Completed); try { gameInviteTask.SessionId = "<my session id>"; gameInviteTask.Show(); } catch (System.InvalidOperationException ex) { MessageBox.Show("An error occurred."); } void gameInviteTask_Completed(object sender, TaskEventArgs e) { switch(e.TaskResult) { //Game logic for when the invite was sent successfully case TaskResult.OK: MessageBox.Show("Game invitation sent."); break; / //Game logic for when the invite is cancelled by the user case TaskResult.Cancel: MessageBox.Show("Game invitation cancelled."); break; // Game logic for when the invite could not be sent case TaskResult.None: MessageBox.Show("Game invitation could not be sent."); break; } } 24
  22. 22. Windows Phone 7Tasks : SaveContactTask SaveContactTask saveContactTask; saveContactTask = new SaveContactTask(); saveContactTask.Completed += new EventHandler<SaveContactResult>(saveContactTask_Completed); try { saveContactTask.FirstName = "John"; saveContactTask.LastName = "Doe"; saveContactTask.MobilePhone = "2065550123"; saveContactTask.Show(); } catch (System.InvalidOperationException ex) { MessageBox.Show("An error occurred."); } 25
  23. 23. Windows Phone 7 Company Gets or sets the name of the company associated with the contact. FirstName Gets or sets the given name of the contact. Gets or sets the city of the home address associated with the HomeAddressCity contact. Gets or sets the country or region of the home address associatedTasks : SaveContactTask HomeAddressCountry with the contact. Gets or sets the state of the home address associated with the HomeAddressState contact. Gets or sets the street name and number of the home address HomeAddressStreet associated with the contact. Gets or sets the postal code of the home address associated with HomeAddressZipCode the contact. HomePhone Gets or sets the home phone number associated with the contact. JobTitle Gets or sets the job title associated with the contact. LastName Gets or sets the surname of the contact. MiddleName Gets or sets the middle name of the contact. MobilePhone Gets or sets the mobile phone number associated with the contact. Nickname Gets or sets the nickname of the contact. Notes Gets or sets a note associated with the contact. Gets or sets an additional email address associated with the OtherEmail contact. PersonalEmail Gets or sets the personal email address associated with the contact. Suffix Gets or sets the suffix of the name of the contact. Title Gets or sets the title of the name of the contact. Website Gets or sets the website associated with the contact. Gets or sets the city of the work address associated with the WorkAddressCity contact. Gets or sets the country or region of the work address associated WorkAddressCountry with the contact. Gets or sets the state of the work address associated with the WorkAddressState contact. Gets or sets the street name and number of the work address WorkAddressStreet associated with the contact. Gets or sets the postal code of the work address associated with WorkAddressZipCode the contact. WorkEmail Gets or sets the work email address associated with the contact. WorkPhone Gets or sets the work phone number associated with the contact. 26
  24. 24. Windows Phone 7Tasks : SaveRingtoneTask try { saveRingtoneChooser.Source = new Uri("appdata:/ReneLaTaupe.mp3"); //saveRingtoneChooser.Source = new Uri("isostore:/ReneLaTaupe.mp3"); saveRingtoneChooser.DisplayName = "My custom ringtone"; saveRingtoneChooser.Show(); } catch (System.InvalidOperationException ex) { MessageBox.Show("An error occurred."); } 27
  25. 25. Windows Phone 7Tasks : ShareLinkTask ShareLinkTask shareLinkTask = new ShareLinkTask(); shareLinkTask.Title = "Code Samples"; shareLinkTask.LinkUri = new Uri("http://soumow.dollon.net", UriKind.Absolute); shareLinkTask.Message = "Have you seen the latest demo ?"; shareLinkTask.Show(); 28
  26. 26. Windows Phone 7 Live Tiles & Push Notifications 29
  27. 27. Windows Phone 7Live Tiles Live Tiles allow content on a tile to be updated and changed remotely to signifly a change in the backend application 30
  28. 28. Windows Phone 7Creating a tile ShellTile.Create(new Uri("/MainPage.xaml", UriKind.Relative), new StandardTileData(){ BackgroundImage = new Uri("isostore:/Shared/ShellContent/image.png", UriKind.Absolute), Title = "Sample"}); Tiles are recto and verso There are also some additional properties that you can use in addition to the basic ones: BackContent - used to display a string onthe back of the tile. The tile itself will automatically rotate betwen the base and secondary content. BackTitle - the title to be displayed on the back of the tile. Count - the count displayed in the corner of the tile. Only displayed on the front side of the tile. BackBackgroundImage - the background image displayed on the back of the tile. 31
  29. 29. Windows Phone 7Update/Deleting tiles Tiles can expire or need updating Enumerate the tiles associated with the application, accessible through the ShellTile.ActiveTiles IEnumerable: foreach (ShellTile tile in ShellTile.ActiveTiles){ Debug.WriteLine(tile.NavigationUri.ToString()); } For each shell tile, we can either Update it (and pass a new instance of StandardTileData with updated content) or Delete it. 32
  30. 30. Windows Phone 7Push Notifications 3 Types of Push Notifications Toast Notifications Tile Notifications Raw Notifications 33
  31. 31. Windows Phone 7Push Notifications : Toast Notifications Title. A boldface string that displays immediately after the application icon. This is defined as the Text1 property in the XML schema. Content. A non-boldface string that displays immediately after the Title. This is defined as the Text2 property in the XML schema. Parameter. A parameter value that is not displayed but passed to your application if the user taps on the toast. This parameter can indicate what page the application should launch to. It can also contain name-value pairs to pass to the application. This is defined as the Param property in the XML schema. 34
  32. 32. Windows Phone 7 Multitasking 35
  33. 33. Windows Phone 7 Fast App switching 36
  34. 34. Windows Phone 7Application Lifecycle Pre-Mango Running Activated Deactivated Restore state Tombstoned Save state 37
  35. 35. Windows Phone 7Application Lifecycle in Mango Running Restore state Activated Deactivated Dormant Save state Tombstoned 38
  36. 36. Windows Phone 7Application Lifecycle in Mango Launch Event private void Application_Launching(object sender, LaunchingEventArgs e) { } Deactivated Event private void Application_Deactivated(object sender, DeactivatedEventArgs e) { } Activated Event private void Application_Activated(object sender, ActivatedEventArgs e) { if(e.IsApplicationInstancePreserved == true) { // Dormant State } else { // Tombstoned State } } Close Event private void Application_Closing(object sender, ClosingEventArgs e) { } 39
  37. 37. Windows Phone 7 Background Agents 40
  38. 38. Windows Phone 7What are background agents? Background Agents are a seperate project from the application you are creating. They are instantiated when the application isn’t in an active state. When the application is in an active state, they don’t run. Maximum of 18 simultaneous agents. Background Agents are desactivated 14 days if they are never used. 41
  39. 39. Windows Phone 7What can/can’t you do with Background Agents Allowed Not Allowed  Tiles  Interact with UI  Toast  XNA Libraries  Location Services  Microphone & Camera  Connectivity  Sensors  Access to  Play audio without using IsolatedStorage the appropriate APIs for  Sockets background sound  Most APIs 42
  40. 40. Windows Phone 7Background Agents  Background Transfer Service  Background Audio  Background Agents  Periodic  On Idle  Alarms and Reminders 43
  41. 41. Windows Phone 7Background Agents Background Agents in Mango take the form of a separate assembly, which gets linked in your WMAppManifest.xml 44
  42. 42. Windows Phone 7 Background Agents Background Transfer Service 45
  43. 43. Windows Phone 7Background Agents : Background Transfer Service Start in foreground, complete in background, even if app is closed Queue (of 5) persists across reboots Single service for many apps, FIFO Download ~20 MB ( > over Wi-Fi) Upload Size ~4 MB (limit to come) Transfers to Isolated Storage 46
  44. 44. Windows Phone 7Background Agents : Background Transfer Service 47
  45. 45. Windows Phone 7 Background Agents ScheduledTask Agent 48
  46. 46. Windows Phone 7Background Agents : ScheduledTask AgentIt is possible to have in Windows Phone 7 to execute codeas a planned tack.There are two types of scheduled tasks therefore one classthat from ScheduledTask for each of these types :PeriodicTask and ResourceIntensiveTask 49
  47. 47. Windows Phone 7Background Agents : ScheduledTask AgentLimitations: Memory 5 Mo Expiration : 2 Weeks Restrained acces to APIs User can desactivate themPeriodicTask : Every 30 minutes (+/-) for 15 seconds Can be dismissed if two many background agents are activeResourceIntensiveTask Runs for 10 minutes Only runs if the phone is plugged in If the phone is connected to Wifi or PC If the phone is 90% Charged If absolutely no application is running on the phone 50
  48. 48. Windows Phone 7Background Agents : ScheduledTask AgentMicrosoft.Phone.Scheduler.PeriodicTask PeriodicTask periodicTask = new PeriodicTask("TaskUniqueNameInApp"); periodicTask.Description = "My Periodic Task Description"; periodicTask.ExpirationTime = DateTime.Now.AddDays(10); ScheduledActionService.Add(periodicTask);Microsoft.Phone.Scheduler.ResourceIntensiveTaskResourceIntensiveTask intensiveTask new ResourceIntensiveTask("TaskUniqueNameInApp");intensiveTask.Description = "My Intensive Task Description";intensiveTask.ExpirationTime = DateTime.Now.AddDays(10);ScheduledActionService.Add(intensiveTask) 51
  49. 49. Windows Phone 7Background Agents : ScheduledTask AgentThen create a class that inherits of ScheduledTaskAgent and override OnInvoke and OnCancel public class TaskScheduler : ScheduledTaskAgent { protected override void OnInvoke(ScheduledTask task) { if (task is PeriodicTask) { } else //is ResourceIntensiveTask { } NotifyComplete(); } } 52
  50. 50. Windows Phone 7 Using APIs, Camera & Sensors 53
  51. 51. Windows Phone 7 Sockets 54
  52. 52. Windows Phone 7SocketsWindows Phone provides the programming interface needed to create and use TCP and UDP sockets. You can selectwhich type of socket to use based on your application’s needs. 55
  53. 53. Windows Phone 7Socketsusing System.Net.Sockets; public string Connect(string hostName, int portNumber) { DnsEndPoint hostEntry = new DnsEndPoint(hostName, portNumber); _socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); socketAsyncEventArgs socketEventArg = new SocketAsyncEventArgs(); socketEventArg.RemoteEndPoint = hostEntry; socketEventArg.Completed += new EventHandler<SocketAsyncEventArgs>( delegate(object s, SocketAsyncEventArgs e) { result = e.SocketError.ToString(); _clientDone.Set(); }); _clientDone.Reset(); _socket.ConnectAsync(socketEventArg); _clientDone.WaitOne(TIMEOUT_MILLISECONDS); }); return result; } 56
  54. 54. Windows Phone 7 Contacts/Calendar 57
  55. 55. Windows Phone 7Contacts/CalendarIn Windows Phone, you can now access the user information asynchrously, and even better you can query them withLinq !!!using Microsoft.Phone.UserData; Get contacts: private void ButtonContacts_Click(object sender, RoutedEventArgs e) { Contacts cons = new Contacts(); //Identify the method that runs after the asynchronous search completes. cons.SearchCompleted += new EventHandler<ContactsSearchEventArgs>(Contacts_SearchCompleted); //Start the asynchronous search. cons.SearchAsync(String.Empty, FilterKind.None, "Contacts Test #1"); } void Contacts_SearchCompleted(object sender, ContactsSearchEventArgs e) { //Do something with the results. MessageBox.Show(e.Results.Count().ToString()); } 58
  56. 56. Windows Phone 7Contacts/Calendarusing Microsoft.Phone.UserData; Get appoinments using Linq: void Appointments_SearchCompleted(object sender, AppointmentsSearchEventArgs e) { try { AppointmentResultsDataLINQ.DataContext = from Appointment appt in e.Results where appt.IsAllDayEvent == false select appt; } catch (System.Exception) { //No results } } 59
  57. 57. Windows Phone 7 Media 60
  58. 58. Windows Phone 7MediaYou can use the following features to consume media in a Windows Phone application: Use the MediaPlayerLauncher class for Windows Phone to embed audio or video using the device media player. Cf. Launchers and Choosers chapter Use the Silverlight MediaElement API to embed audio or video using a more customizable interface. MediaElement for Windows Phone has a few differences than MediaElement for the desktop. Add sound effects using XNA Game Studio. Use the MediaStreamSource class for adaptive streaming solutions. Use Microsoft.Phone.BackgroundAudio to create a media application that will continue playing audio when another application is in the foreground. Cf. background agents chapter 61
  59. 59. Windows Phone 7Media : MediaElement <MediaElement Name="mediaElement1" Source="http://mschannel9.vo.msecnd.net/o9/mix/09/wmv/key01.wmv" AutoPlay="True"/> mediaElement1.Play(); mediaElement1.Pause(); mediaElement1.Stop(); 62
  60. 60. Windows Phone 7Media : Integration with the music hub 63
  61. 61. Windows Phone 7Media : Integration with the music hubYour Music + Videos Hub application must conform to the Application CertificationRequirements for Windows Phone to integrate with the Music + Videos Hub. Tiles that are displayed in the Music + Videos Hub must conform to additional iconography rules:  You must include your application title or logo on each Tile.  The now playing Tile must be 358 pixels x 358 pixels. The file size must be 75 KB or less.  Other tiles must be 173 pixels x 173 pixels in size.  The Title property of the MediaHistoryItem class must be set to text that represents the content, such as a station name or video title. To help avoid confusion for users, Hub Tiles should not contain album art unless the album plays when the Hub Tile is pressed. If your application plays a stream, the Hub Tile graphic should describe the stream that is being played. This is not a certification requirement, it is a good practice. 64
  62. 62. Windows Phone 7 Media : Integration with the music hubUpdating the now playing Tile of the history List MediaHistoryItem mediaHistoryItem = new MediaHistoryItem(); //<hubTileImageStream> must be a valid ImageStream. mediaHistoryItem.ImageStream = <hubTileImageStream>; mediaHistoryItem.Source = ""; mediaHistoryItem.Title = "NowPlaying"; mediaHistoryItem.PlayerContext.Add("keyString", "Song Name"); MediaHistory.Instance.NowPlaying = mediaHistoryItem; 65
  63. 63. Windows Phone 7 Camera API 66
  64. 64. Windows Phone 7Application Lifecycle Pre-MangoWindows Phone supports programmatic access to the camera on a device, offering a richset of APIs for developers to create their applications.Some features include: Creating a camera application with a viewfinder and capturing still photos Providing real-time access to raw frames from the camera Adjusting the resolution of the captured photo Implementing functionality such as focus and flash Detecting and querying the device camera capabilities such as flash Accessing the camera hardware shutter button for capturing photos and triggering auto-focus 67
  65. 65. Windows Phone 7Camera API 68
  66. 66. Windows Phone 7Camera API To use a camera in your Windows Phone application, you must add the camera capability (ID_CAP_ISV_CAMERA) to the application manifest file. <Capability Name="ID_CAP_ISV_CAMERA"/> <Capability Name="ID_HW_FRONTCAMERA"/> 69
  67. 67. Windows Phone 7 Conclusion 70
  68. 68. Any questions ? 71

×