El documento describe la arquitectura de la plataforma de desarrollo de Windows Phone 7, incluyendo las herramientas, frameworks y capacidades de integración con la nube. Explica que las aplicaciones se desarrollan principalmente con Silverlight o XNA y se integran con servicios de Microsoft como la localización, notificaciones y Xbox Live. También describe los modelos de aplicación e interfaz de usuario y cómo se gestiona la navegación entre páginas y aplicaciones.
8. Arquitectura de la Plataforma de Desarrollo Nube Pantalla Emulador Telefono Ejemplos Documentacion Guias Comunidad Herramientas de Empaquetado y Verificacion Notificationes Localizacion Identidad Feeds Mapas Social Despliegue Aplicaciones Registro Validacion Certificacion Publicacion Marketplace Facturacion Inteligencia Negocios Gestion Actualizaciones Herramientas & Soporte Servicios Portal Desarrollador Servicios en la Nube Sensores Media Datos Servicios Juegos Notificaciones Codigo Manejado .NET en Sandbox Localizacion Telefono Run Time – Interfaz Usuario
9. Arquitectura de la Plataforma de Desarrollo Kernel Hardware BSP Modelo de Aplicación Modelo de IU Integración con Nube Aplicaciones y Juegos Gestión Aplicac. Licenciamiento Aislamiento Actualizaciones de Sw Shell frame Gestión de Sesiones Direct3D Compositor Xbox LIVE Bing Localización Notificaciones Push Windows Live ID A-GPS Acelerómetro Brújula Proximidad de Luz Media Wi-Fi Radio Gráficos Seguridad Networking Almacén Datos Frameworks Silverlight XNA HTML/JavaScript CLR Especificación Hardware
18. Modelo de Aplicación: Conceptos Aplicación Software identificable y licenciable empaquetado como XAP. Despliegue de Aplicación Licencia de Aplicación Objeto verificable por criptografía que permite dar derechos de uso de la aplicación Windows Phone Marketplace Windows Phone Marketplace Mi aplic.xap
19.
20.
21. Modelo de IU: Conceptos Aplicación Funcionalidad IU y lógica expuesta a través de páginas Pagina Una pantalla de usuario con elementos de interacción de usuario Sesión Un workflow ordenado de interacciones de usuario que engloban varias aplicaciones
22. UI Model: Familiar Web Concepts Phone application Provides UI represented as XAML pages connected into cross-app flows by URI’s Web application Provide media represented as HTTP resources linked by URL’s Shell frame Requests pages, renders UI, and handles navigation across apps Sessions and back stack Groups together sequences of pages corresponding to a user’s activity across apps Web browser Requests HTTP resources, renders them, and handles navigation across sites History and tabs Groups together sequences of HTTP resources corresponding to a user’s activity across sites
23. Ejemplo de Navegación de IU Fotos Vistazo a fotos recientes Gente Buscar el estado de un contacto Fotos Seguimos mirando fotos recientes Sesiones Activas
24. UI and State Management: Concepts Page UI Describes the visual appearance of a page Page State Contains data that describes an instance of a page, analogous to browser cookie Retained in shell frame to support resuming paused sessions Discarded while the session is paused
25. UI and State Management: Example Running Applications Dehydrated and rehydrated on demand from saved state Shell Frame Monitors resource usage to decide when to pause sessions Apps restarted and UI rehydrated as the user navigates thru the phone
28. Frameworks en Detalle Common Base Class Library Colecciones ComponentModel Configuración Diagnostics Reflection IO Seguridad Threading Runtime Recursos Globalización Texto Localización Net ServiceModel Linq Objeto de Aplicación Presentación y Media de Silverlight Frameworks XNA para Juegos Frameworks de Windows Phone Navegación Formas XAML Media Controles Drawing IsolatedStorage Audio Media Gráficos Entrada Datos Drawing GamerServices Contenido PhoneApplicationPage PushNotification WebBrowserControl Sensors PhoneApplicationFrame Cámara Integración con Dispositivo Tareas Controles Windows Phone
35. Arquitectura de Cliente de Localización Servicio de Localización IU y lógica de Aplicación Radio Wi-Fi A-GPS Microsoft Services Seguridad Windows Phone Location Service Kernel Hardware BSP Modelo de Aplicación Modelo de IU Integración con Nube Aplicaciones y Juegos Gestión Aplicac. Licenciamiento Aislamiento Actualizaciones de Sw Shell frame Gestión de Sesiones Direct3D Compositor Xbox LIVE Bing Localización Notificaciones Push Windows Live ID A-GPS Acelerómetro Brújula Proximidad de Luz Media Wi-Fi Radio Gráficox Seguridad Networking Almacén Datos Frameworks Silverlight XNA HTML/JavaScript CLR Especificación Hardware
36.
37.
38. Arquitectura del Cliente “Push” Microsoft Services Microsoft Push Notification Service Servicio de cliente “Push” Microsoft.Phone.Notification Administrador Descargas Servicio de “Tiles” Networking Radio Wi-Fi IU y lógica de la aplicación Kernel Hardware BSP Modelo de Aplicación Modelo de IU Integración con Nube Aplicaciones y Juegos Gestión Aplicac. Licenciamiento Aislamiento Actualizaciones de Sw Shell frame Gestión de Sesiones Direct3D Compositor Xbox LIVE Bing Localización Notificaciones Push Windows Live ID A-GPS Acelerómetro Brújula Proximidad de Luz Media Wi-Fi Radio Gráficox Seguridad Networking Almacén Datos Frameworks Silverlight XNA HTML/JavaScript CLR Especificación Hardware
39.
40.
41. Arquitectura de Gamer Services Microsoft Services Xbox LIVE Windows Live ID APIs de XNA Gamer Services Servicio cliente Live ID Game Foundation Almacen datos Networking Kernel Hardware BSP Modelo de Aplicación Modelo de IU Integración con Nube Aplicaciones y Juegos Gestión Aplicac. Licenciamiento Aislamiento Actualizaciones de Sw Shell frame Gestión de Sesiones Direct3D Compositor Xbox LIVE Bing Localización Notificaciones Push Windows Live ID A-GPS Acelerómetro Brújula Proximidad de Luz Media Wi-Fi Radio Gráficox Seguridad Networking Almacén Datos Frameworks Silverlight XNA HTML/JavaScript CLR Especificación Hardware
46. Graphics Architecture App UI and logic Graphics driver Window manager Direct3D Compositor Shell frame HTML/JavaScript XNA Silverlight
Notas del editor
Services and Applications Starting point is a Web API (either your own or 3rd party) Optionally reachable through a Web Site in the Browser Take away the browser but allow dealing with 3 different sets of screens, getting the best experiences out of all of them PC Keyboard + mouse for user interaction (optionally touch as well) The user sits close to the screen Typically has a high resolution screen with a lot of information displayed on it TV Remote control for user interaction The user sits at a distance, usually in a living room with multiple people Device (Phone) Touch screen for user interaction (optionally keyboard as well) Glance at information quickly User puts the device away frequently Be aware of battery life Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
Yes. The compass hardware is required in all WP7 devices. As noted below the API didn’t make it for v1. BSP= Yes. The compass hardware is required in all WP7 devices. As noted below the API didn’t make it for v1. bsp =board support package Of course the software architecture is built on top of the Windows Phone hardware foundation It contains a brand new OS, based on the Windows CE kernel with support for: Virtual Memory; Paging; Security and Networking (all similar to the Windows desktop operating system) The BSP, together with most device drivers, is written by Microsoft. This is different from previous Windows Mobile versions, but allows for great standardization and quality assurance across devices Hardware vendors only need to write a few, very silicon specific parts of device drivers The Application Model is brand new and rich and includes a flexible packaging model to deliver applications / updates Service based update / delivery model Interaction with the kernel security model New page-based User Interface Model, taking advantage of the form factors on the phone Shell provides first class UI experiences and orchestration across pages Graphics are deeply integrated in the OS/HW stack, using DirectX capable hardware Brand new compositor which allows managing application navigation and transactions easily Cloud Integration A number of existing and new Microsoft hosted services are tightly integrated with the phone All are based on Windows Live Authentication Location and Notification services are especially built for the phone Application Runtime is in fact a Common Language Runtime (allowing managed code only applications) Three different ‘rendering’ engines Silverlight (UI) – Modern, animation based UI + support for business logic XNA – Specifically for gaming with 2D / 3D graphics and content pipeline HTML / Javascript capabilities through the IE browser engine Frameworks are available to provide application developers with an API This layer also gives applications access to different phone capabilities (sensors, phone radio, etc.) Your application logic sits on top of the Frameworks. It will consist of managed code only (with a small exception for browser based content, which lives in a browser sandbox) Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
Let’s dig a bit deeper into the application model What is an application? A uniquely identifiable, licensable and serviceable software product, wrapped in a flexible deployment package (XAP) Qué es un XAP: Common format for all Windows Phone apps & games Declarative, manifest-based installation Integrated into security model of phone How does an application get on the phone? Develop an application Submit it to Marketplace Application will be verified (code is checked, code is signed) User can download and deploy a signed application from Marketplace Each application has a license, which grants the user to run the application on their phone Licenses distinguish between trial, beta + purchased versions with different lifetimes and capabilities Assures that only identifiable applications gets on the phone Protects the experience of the end user Protects the rights of the software developer (application does not run without a license)
Once an application is installed on the phone, the user can execute it. Application execution works as described here (to assure a good end-user experience) Applications are running in ‘traditional’ processes, but they are running in complete isolation from each other Applications can not break each other OS can make sure that an application has enough resources to run Applications can not ‘steal’ data from each other The Resource Manager on the phone guarantees a good responsiveness to the end-user, amongst others by making sure that: Foreground applications have absolute priority and get all resources they need (CPU, memory, UI) Background applications will get less access to resource Applicaiton hosting and runtime: When an application launches it starts running inside a host process that is using the CLR runtime [Animate] The code is signed, licensed and always checked before executing the application (Is the license valid? Is the code still signed? Is de code unmodified?) The runtime guarantees that no unauthorized code can execute on the phone [Animate] The OS guarantees that an application can only access system resources on the phone for which the application has been granted access permission Since each application is uniquely identified, access rights can be granted during application deployment. When executing, the runtime enforces access right checks (similar to a user account with its own rights) Access rights are for instance checked when an application wants to access its data folder, its read-only install folder, hardware sensors and networking functionality. System provides host process for app code Sandbox enforced for host process based on declared capabilities Each app executes inside an isolated, least-privileged host process All app code is transparent and CLS-verifiable, mitigating impact of common attacks Frameworks enable app code to interact with app model, UI model, phone functionality Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
What is an application from a User Interface perspective? The User Interface itself + programming logic, presented to the user in a number of different pages A page is a single screen, containing some UI element to interact with a user The user deals with pages, and does not necessarily think about applications A session is a stack of pages that expand over applications (the pages that the user visits) The user achieves things through experiences that communicate to the user by means of pages Distinction between different applications on the phone is blurred The System is responsible to give users a unified experience, independent from an application that implements that particular experience FAMILIAR WEB CONCEPTS If you compare the Windows Phone 7 UI model with a browser based UI model you will notice that they are very similar Web Applications are identified with a URI Present their UI through pages Enhance by the browser by providing a back stack + a tab based model to switch across experiences Phone Applications are identified with a URI Present their UI through pages, organized into sessions Sessions are saved on the phone in a back stack for navigation purposes Building page based applications has advantages: Applications consist of small components (pages) Adding complexity + functionality gradually by adding additional pages Still small individual components, which works very good on a resource limited device like a phone Page model works intuitive for an end-user and fits the phone form factors very well
If you compare the Windows Phone 7 UI model with a browser based UI model you will notice that they are very similar Web Applications are identified with a URI Present their UI through pages Enhance by the browser by providing a back stack + a tab based model to switch across experiences Phone Applications are identified with a URI Present their UI through pages, organized into sessions Sessions are saved on the phone in a back stack for navigation purposes Building page based applications has advantages: Applications consist of small components (pages) Adding complexity + functionality gradually by adding additional pages Still small individual components, which works very good on a resource limited device like a phone Page model works intuitive for an end-user and fits the phone form factors very well
Here is an example of navigation on the phone in action The user goes to the start screen by clicking on the start hardware button The user selects the picture experience to take a look at some newly added pictures The user goes to the next page of the picture experience While working with the picture experience, the user decides to lookup some contact information The user goes to the start screen by clicking on the start hardware button The user selects the contacts / people experience to lookup information for one of their contacts The other session (the picture experience) is still there, but it is currently in the background (might even be swapped out over time) The user is now interacting with a new session which is currently in the foreground and can use all the phone resources The user goes to the start screen by clicking on the start hardware button The user selects the picture experience and automatically continues at the page where they left the experience previously The picture experience is moved into the foreground again, and is literally resumed The contacts experience is now the background experience Both the pictures and contacts experiences are currently marked as active sessions on the phone, even though the user is only interacting with one of them, the foreground session (which is the picture experience) UI and State Management concepts: Each page has the ability to store its state when the application goes to the background. This means that, even if the UI for an application (page) is removed, which might eventually happen if an application is in the background, the UI can always be re-constructed from the saved state. You can almost think about the UI of an individual application on the phone as being virtualized. The concept works similar to the concept of using cookies inside web based applications. A cookie stores a session state for an individual user, which allows resuming a previously stored state by asking a server to present the same information again. The phone works in a similar way. Retain the state of a page and afterwards resume the session and display the page dynamically, based on the stored state. [Animate] The page state thus describes instance data and is retained in the shell frame. [Animate] The UI can be discarded when the session is paused (placed into the background). All processing necessary to resume an application is completely transparent to the end-user. UI and State Management Sample In this slide you can see two applications having active sessions (one of the applications is in the background, the left hand application). The memory load of the phone is fairly high (represented by the middle diagram). [Animate] The high memory load can cause the current background application to be discarded to free up more memory on the device (dehydrated situation) [Animate] When the user returns to the previous application, its state is restored and the application is displayed again (rehydrated situation) Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
Each page has the ability to store its state when the application goes to the background. This means that, even if the UI for an application (page) is removed, which might eventually happen if an application is in the background, the UI can always be re-constructed from the saved state. You can almost think about the UI of an individual application on the phone as being virtualized. The concept works similar to the concept of using cookies inside web based applications. A cookie stores a session state for an individual user, which allows resuming a previously stored state by asking a server to present the same information again. The phone works in a similar way. Retain the state of a page and afterwards resume the session and display the page dynamically, based on the stored state. [Animate] The page state thus describes instance data and is retained in the shell frame. [Animate] The UI can be discarded when the session is paused (placed into the background). All processing necessary to resume an application is completely transparent to the end-user. The Windows Phone Application Platform
In this slide you can see two applications having active sessions (one of the applications is in the background, the left hand application). The memory load of the phone is fairly high (represented by the middle diagram). [Animate] The high memory load can cause the current background application to be discarded to free up more memory on the device (dehydrated situation) [Animate] When the user returns to the previous application, its state is restored and the application is displayed again (rehydrated situation) The Windows Phone Application Platform
Here you can see a high level overview of the different Frameworks that are available on the Phone Base Class Library: Platform independent access to common functionality Silverlight: UI presentation & media XNA: Content & 2D – 3D graphics Device Integration: Access to device capabilities and services The Windows Phone Application Platform
In detail, the top layer Framework gives you access to phone specific capabilities, including sensors, camera and navigation, integration with push notification services as well as HTML / JavaScript functionality through the WebBrowser Underneath the Windows Phone Frameworks you can see the different presentation layers, specific for Silverlight or XNA type of applications An application gets access to the system through the application object The Common Base Class Library is shared between the presentation layers (it should be familiar to .NET developers) and contains all platform independent base framework functionality that is shared amongst managed applications across all platforms. Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
DEMO: Input: SIP, acelerómetro, MIC y Multitouch DEMO : Launchers and Choosers (DEMO)
Built-in user experiences and APIs integrated with key Microsoft services Familiar API frameworks for interacting with existing Web 2.0 services Rich support for incorporating custom web services into app-specific experiences Windows Phone 7 is a very powerful and rich platform, but the cloud is way more powerful. It provides more functionality, scalability, the cloud is always on (unlike the phone), the cloud has unlimited power (the phone has very limited power) and can be accessed from anywhere. It makes sense to take advantage of the cloud on the phone to get additional functionality In order to do so, some client side functionality, accessible via frameworks from within applications, is always running in the background on the phone to communicate with specific cloud services [Animate] Microsoft provides a number of services, two of which (Location Service and Notification Service) are specific for the phone, while others have first class integration with the phone (Windows Live, Bing, Xbox Live) [Animate] You can also interact from within your own application with existing web services. Silverlight on the phone relaxes some security constraints to allow calling out to web services without cross domain policy checks [Animate] And of course you can access your own web services as well, thus extending the phone functionality even further Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
The Location Service makes use of the phone’s built-in GPS radio, but it also uses assisted GPS (incorporating cell tower or Wi-Fi data) The Location Services in the cloud, together with Microsoft Bing provide geocoding and reverse geocoding services to incorporate real address information instead of Latitude / Longitude only Depending on the desired accuracy for an application, the phone might retrieve location through different radios Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
The Location Client side architecture shows that your application must be allowed access to the location service by the user, otherwise it can’t retrieve location information. The device determines if it should use the GPS radio, Wi-Fi or cell tower lookup to retrieve its current location, depending on the requested accuracy by applications. If an application does not need incredibly accurate location information it should tell this to the system. If the system can retrieve location information without the use of the GPS radio, not only will is the location information available faster, but the battery life is extended as well. The Windows Phone Application Platform
The basic idea of the Push Notification Service is to give you the ability to send information to your application on the phone, even if the application is not running. This is a battery friendly approach, because the application does not have to run and it does not have to poll for information or consume other resources on the phone. An application registers with the Push Notification Service The application receives a URI to which your own web companion service can sent information (simple HTTP PUT / HTTP POST). The Notification Service will send the information in an efficient way to the phone The Notification Service can decide to use batching to send bundles of information to a particular phone The Notification Service can delay sending information to the phone in case of low resources (can even be shut down entirely in low battery situations) Use for notifications only, because notifications might be delayed / dropped depending on the state of the phone! The Windows Phone Application Platform
The phone contains two different local services (Live Tiles & Push Client) Live Tiles Service uses the Download Manager to update Tile Information for your application (e.g. update the Tile Image by passing a URI to a new image) The Windows Phone Application Platform
Enseñar funcionando outloud con notificaciones «tostada», tile y raw
The Xbox Live Integration Service allows access to achievements and game scores both from Silverlight and XNA based games on the phone A client side run-time is available that runs on behalf of the Xbox Live Service which handles multiple things: Authentication Provision of authentication tokens to other services Caching of information in case of no connectivity The next time the phone is connected it will ‘synchronize’ cached data The Windows Phone Application Platform
Behind the scenes, the Game Foundation uses the Windows Live ID (that is locally stored on the phone in the Live ID Client Service) The Game Foundation is typically accessed from the XNA Gamer Services API, but can also be accessed from Silverlight Some specific Xbox Live game functionality might not be directly available for your application on a Windows Phone 7
Enseñas zombies con todo lo que trae DEMO de una solución completa (no de hacer el desarrollo, sino en plan showcase): Zombie!!! HUB: Esta aplicación mostrará el potencial que puede tener una aplicación de WP7 utilizando las API de WP7 que acabamos de mostrar, integrando Launchers, App Bar, Tiles, Web Browser, Multitouch, MIC, Media, Vibration, etc… Y de aquí daremos paso a ver como se desarrollan aplicaciones como esta en Silverlight en la siguiente sesión, que será donde haremos paso a paso la aplicación de Plain.
Page frames are maintained and stored for the entire Phone System. It is possible to have overlay screens being displayed on top of each other. The start experience has its own page If the user launches an application, that application also gets its own page On top of the application’s page, the software input panel will be displayed as an overlay when your application needs user input. The SIP is not rendered inside the application page, and as an application developer you don’t have to worry about the SIP appearing or disappearing. It is a separate layer with its own separate screen The same is true for the application bar. It is composed on top of an application and is a system wide resource, responsible for its own drawing The overlay system makes very good user experiences possible, for instance when a phone call comes in, the current application UI is interrupted and overlayed by the incoming call UI The system tray, notifications and the volume bar are also examples of overlayed UI experiences The Shell frame is responsible of composing a single screen of the entire UI (including overlays) Overlays are centralized and do not disturb individual UI rendering code for an application The system maintains a global Z order to assure that the right information is always shown at the right time on the phone Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential
Behind the scenes, these are the components that are responsible for displaying information, ranging from the window manager, the graphics driver, the graphics subsystem all the way to the different presentation layers on top of which your application wants to show information to the user. Windows 7 | Presenter Mode Thursday, October 21, 2010 Microsoft Confidential