1 / 52

Mango Mango! Developing for Windows Phone 7

Mango Mango! Developing for Windows Phone 7. Pongsakorn Poosankam. Microsoft Innovation Center Manger. http://www.fb.com/groups/wpthaidev/. Timeline of Windows Phone. Cloud and Integration Services. App Model. UI Model. Software Foundation. Hardware Foundation.

abla
Download Presentation

Mango Mango! Developing for Windows Phone 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Mango Mango! Developing for Windows Phone 7 Pongsakorn Poosankam Microsoft Innovation Center Manger http://www.fb.com/groups/wpthaidev/

  2. Timeline of Windows Phone Cloud and Integration Services App Model UI Model Software Foundation Hardware Foundation

  3. List of Windows Phone Devices

  4. Cloud and Integration Services Hardware Foundation App Model UI Model Software Foundation Hardware Foundation

  5. Hardware Foundation Updates Capacitive touch 4 or more contact points 800 Motion Sensor Sensors A-GPS, Accelerometer, Compass, Light, Proximity, Gyro Compass Camera Camera 5 mega pixels or more Improved capability detection APIs Multimedia Common detailed specs, Codec acceleration Memory 256MB RAM or more, 8GB Flash or more GPU DirectX 9 acceleration CPU Qualcomm MSM8x55 800Mhz or higher MSM7x30 Hardware buttons | Back, Start, Search 480

  6. Accelerometer +Y • Measures resultant acceleration (force) on device • Pros: • Available on all devices • Cons: • Difficult to tell apart small orientation changes from small device motions -Z -X +X

  7. Camera • Access to live camera stream • PhotoCamera • Silverlight 4 Webcam • Display in your app • Video Brush

  8. When to use each approach PhotoCamera Webcam Record Video Record Audio Share code with desktop Access Samples (Push Model) • Take High Quality Photos • Handle Hardware Button • Handle Flash mode and Focus • Access Samples (Pull Model)

  9. Camera demo

  10. Gyroscope • Measures rotational velocity on 3 axis • Optional on Mango phones • Not present in pre-Mango WP7 phones

  11. Gyroscope API

  12. Motion Sensor • Virtual sensor, combines gyro + compass + accelerometer • Motion Sensor vs. gyro or compass or accelerometer • More accurate • Faster response times • Comparatively low drift • Can disambiguate motion types • Has fall-back if gyro is not available Always prefer Motion Sensor when available

  13. Motion API if (Motion.IsSupported) { _sensor = new Motion(); _sensor.CurrentValueChanged += new EventHandler<SensorReadingEventArgs<MotionReading>> (sensor_CurrentValueChanged); _sensor.Start(); } void _sensor_CurrentValueChanged(object sender, SensorReadingEventArgs<MotionReading> e) { Simple3DVector rawAcceleration = new Simple3DVector( e.SensorReading.Gravity.Acceleration.X, e.SensorReading.Gravity.Acceleration.Y, e.SensorReading.Gravity.Acceleration.Z); … }

  14. Motion Sensor Adapts to Devices • Degraded modes have lower quality approximations • When Motion.IsSupported is false, apps should use accelerometer or other input and control mechanisms

  15. Sensor Calibration • Calibration Event is fired when calibration is needed • Both Compass and Motion sensors need user calibration • Apps should handle it • Provide UI asking user to move device through a full range of orientations • Not handling will cause inaccurate readings • We are considering providing copy & paste solution

  16. Cloud and Integration Services Software Foundation App Model UI Model Software Foundation Hardware Foundation

  17. Run-time improvements • Silverlight 4 • Features • Performance • Implicit styles • RichTextBox • ViewBox • More touch events (tap, double tap) • Sockets • Clipboard • IME • WebBrowser (IE9) • VideoBrush • Gen GC • Input thread • Working set • Profiler

  18. Networking • Sockets • TCP • UDP unicast, Multicast ( on Wi-Fi) • Connection Manager Control • Overrides and sets preferences(e.g. Wi-Fi or cellular only) • HTTP • Full header access • WebClient returns in originating thread

  19. Silverlight and XNA Shared Graphics • XNA inside Silverlight App • Integration at Page Level • XNA takes over rendering • Integration at Element level • Silverlight elements in XNA pipeline via UIElementRenderer • Shared input

  20. Silverlight + XNA demo

  21. Local database • SQL Compact Edition • Use object model for CRUD • LINQ to SQL to query, filter, sort • Application level access • Sandboxedfrom other apps • Uses IsolatedStorage • Access for background agents • DatabaseSchemaUpdater APIs for upgrades SQL CE

  22. Database APIs: Datacontext and attributes // Define the data context. publicpartialclassWineDataContext: DataContext { publicTable<Wine> Wines; publicTable<Vineyard> Vineyards; publicWineDataContext(stringconnection) : base(connection) { } } // Define the tables in the database [Table] publicclassWine { [Column(IsPrimaryKey=true] publicstringWineID{ get; set; } [Column] publicstringName { get; set; } …… } // Create the database form data context, using a connection string DataContextdb = newWineDataContext("isostore:/wineDB.sdf"); if (!db.DatabaseExists()) db.CreateDatabase();

  23. Queries: Examples // Find all wines currently at home, ordered by date acquired varq = from w indb.Wines wherew.Varietal.Name == “Shiraz” && w.IsAtHome == true orderbyw.DateAcquired select w; WinenewWine = newWine { WineID = “1768", Name = “Windows Phone Syrah", Description = “Bold and spicy" }; db.Wines.InsertOnSubmit(newWine); db.SubmitChanges();

  24. Local databasedemo

  25. Cloud and Integration Services Application Model App Model UI Model Software Architecture Hardware Foundation

  26. Fast Application Resume • Immediate Resume of recently used applications • Apps stay in memory after deactivation • New “task switcher” • Long-press back button • While dormant • Apps are not getting CPU cycles • Resources are detached • You must recompile and resubmit targeting Mango

  27. Fast App Resumedemo

  28. Multi-tasking Options • Background Transfer Service • Background Audio • Background Agents • Periodic • On Idle • Alarms and Reminders

  29. Background Audiodemo

  30. Generic Agent Types Periodic Agents • Occurrence • Every 30 min • Duration • ~15 seconds • Constraints • <= 6 MB Memory • <=10% CPU On Idle Agents • Occurrence • External power, non-cell network • Duration • 10 minutes • Constraints • <= 6 MB Memory All of this is requirements can change before RTM, but should not change too much

  31. Background Agent Functionality Restricted Allowed • Tiles • Toast • Location • Network • R/W ISO store • Sockets • Most framework APIs • Display UI • XNA libraries • Microphone and Camera • Sensors • Play audio(may only use background audio APIs)

  32. Agentdemo

  33. Notifications • Time-based, on-phone notifications • Supports Alerts & Reminders • Persist across reboots • Adheres to user settings • Consistent with phone UX

  34. Alarms API usingMicrosoft.Phone.Scheduler; privatevoidAddAlarm(object sender, RoutedEventArgs e) { Alarmalarm = newAlarm("Long Day"); alarm.BeginTime= DateTime.Now.AddSeconds(15); alarm.Content= "It's been a long day. Go to bed."; alarm.Title= "Alarm"; ScheduledActionService.Add(alarm); } Alarms

  35. Reminders API usingMicrosoft.Phone.Scheduler; privatevoidAddReminder(object sender, RoutedEventArgs e) { Reminderreminder = newReminder("CompanyMeeting"); reminder.BeginTime = DateTime.Now.AddSeconds(15); reminder.Content = "Soccer Fields by The Commons"; reminder.Title = "Microsoft Annual Company Product Fair 2009"; reminder.RecurrenceType = RecurrenceInterval.Yearly; reminder.NavigationUri= newUri("/Reminder.xaml", UriKind.Relative); ScheduledActionService.Add(reminder); } Reminders

  36. Alarms & remindersdemo

  37. Background Transfer Service • Start transfer in foreground, complete in background, even if app is closed • Queue persists across reboots • Queue size limit = 5 • Queue APIs (Add, Remove, Query status) • Single service for many apps, FIFO • Download ~20 MB ( > over Wi-Fi) • Upload Size ~4 MB (limit to come) • Transfers to Isolated Storage

  38. Background Transfer Service API Needs more! usingMicrosoft.Phone.BackgroundTransfer; voidDownloadWithBTS(UrisourceUri, UridestinationPath) { btr= newBackgroundTransferRequest(sourceUri, destinationUri); btr.TransferStatusChanged += BtsStatusChanged; btr.TransferProgressChanged+= BtsProgressChanged; BackgroundTransferService.Add(btr); } voidBtsProgressChanged(object sender, BackgroundTransferEventArgs e) { DrawProgressBar(e.Request.BytesReceived); }

  39. Cloud and Integration Services IntegrationServices App Model UI Model Software Architecture Hardware Foundation

  40. Live Tile improvements • Local Tile APIs • Full control of ALL properties • Multiple tiles per app • Create,Update/Delete/Query • Launches direct to Uri Application Tile Launches main app experience Secondary Tile Launches world news page Secondary Tile Launches local news page

  41. Live Tiles – Local Tile API Continued… • Back of tile updates • Full control of all properties when your app is in the foreground or background • Content, Title, Background • Flips from front to back at random interval • Smart logic to make flips asynchronous Content Content string is bigger Background Title Title

  42. Live tilesdemo

  43. Push Notifications (Core) Enhancements 30 Endpoints Limit !!!

  44. Push Notifications – New Features! • MultiTile/Back of Tile Support • Can update all tiles belonging to your application • No API Change! – BindToShellTile now binds you to all tiles • Send Tile ID to service and use new attribute to direct update • 3 new elements for back properties: BackBackgroundImage, BackContent, BackTitle • Deep Toast • Take users directly to an application experience • Uses standard SL navigation (OnNavigatedTo) • No API change! – BindToShellToast still all you need. • New element to send query parameters with a toast: Param

  45. New Choosers and Launchers • SaveRingtoneTask • AddressChooseTask • BingMapsTask • BingMapsDirectionsTask • GameInviteTask • Updates: • EmailAddressChooserTask • PhoneNumberChooserTask

  46. http://research.microsoft.com/en-us/um/redmond/projects/hawaii/http://research.microsoft.com/en-us/um/redmond/projects/hawaii/ http://watwp.codeplex.com English to Thai Dictionary from Thai Software Enterprise use OCR in the Cloud.

  47. Announcing 4 New Global Publishers Helping more developers from more countries Unlock Phones Submit apps to Marketplace

  48. Marketplace Distribution Options Preliminary, subject to change People who obtain deeplink can access

  49. The Marketplace Test Kit The Marketplace Test Kit lets you perform the same tests on your application before you submit it Vastly improves chances of the application passing first time

  50. MyDolls – Developed by Students Top Paid in “Social” Category $0.99 3rd Student from Com. Sci., Chulalongkorn University

More Related