Bài giảng Lập trình cho thiết bị di động Windows Phone - Trần Duy Thanh - Introduction Windows Phone OS
1. History WINDOWS PHONE OS
2. New Features Windows Phone 8
3. Windows Phone OS vs Another
4. Windows phone architecture
5. WP SDK & Tool Development
6. Getting Started Windows phone 8
7. Application LifeCycle
8. Taking Your App to Market
Tóm tắt nội dung Bài giảng Lập trình cho thiết bị di động Windows Phone - Trần Duy Thanh - Introduction Windows Phone OS, để xem tài liệu hoàn chỉnh bạn click vào nút "TẢI VỀ" ở trên
Phone 8 SDK install. If you already have Visual Studio Professional, Premium, or Ultimate installed, the SDK will install as an add-in to your existing version. 55 6. Getting Started Windows phone 8 Creating a Windows Phone 8 Project Windows Phone 8 Solution Anatomy Running Applications from Visual Studio Using the Emulator Register real phone for development 56 6. Getting Started Windows phone 8 Creating a Windows Phone 8 Project Run Microsoft Visual Studio Express 2012 for Window Phone File New Project to create a windows phone project 57 6. Getting Started Windows phone 8 Creating a Windows Phone 8 Project Choose as the same configuration, and then click OK button 58 6. Getting Started Windows phone 8 Creating a Windows Phone 8 Project Choose Windows phone OS 8.0, click OK The Target Windows Phone OS version is popup: 59 6. Getting Started Windows phone 8 Creating a Windows Phone 8 Project Please wait some minutes…. Creating project 60 6. Getting Started Windows phone 8 F5 to display the application and page titles in the emulator 61 6. Getting Started Windows phone 8 Windows Phone 8 Solution Anatomy 62 6. Getting Started Windows phone 8 Windows Phone 8 Solution Anatomy Solution Explorer Properties Editor development XAML designer Emulator designer Toolbox Output Document Outline 63 6. Getting Started Windows phone 8 Windows Phone 8 Solution Anatomy Project folder explorer .xap format 64 6. Getting Started Windows phone 8 Windows Phone 8 Solution Anatomy AppManifest.xml lists resources to include when deploying the application. Visual Studio takes care of maintaining this file for you. This file is located in the Properties folder of the project. WMAppManifest.xml describes the application in more detail including the Display Name, starting Navigation Page, App Icon, a list of Capabilities and hardware Requirements. This file is located in the Properties folder of the project. 65 6. Getting Started Windows phone 8 Properties of WMAppManifest.xml Application UI Capabilities Requirements Packaging 66 6. Getting Started Windows phone 8 Properties of WMAppManifest.xml Application UI Capabilities Requirements Packaging 67 6. Getting Started Windows phone 8 Properties of WMAppManifest.xml Application UI Capabilities Requirements Packaging 68 6. Getting Started Windows phone 8 Properties of WMAppManifest.xml Application UI Capabilities Requirements Packaging 69 6. Getting Started Windows phone 8 Windows Phone 8 Solution Anatomy The Assets folder: contains the images for the application icon and the tile images that display in the Windows Phone 8 Start screen. The Resources folder: allows your application to be localized for particular languages and cultures. The LocalizedStrings class: provides access to language resources and can be referenced in your application’s user interface. The App class : Is defined in files App.xaml and App.xaml.cs located in the root directory of the project. 70 6. Getting Started Windows phone 8 App class 71 6. Getting Started Windows phone 8 The initial main page is created automatically and contains a .XAML (Extensible Application Markup Language) file to describe the user interface and a .XAML.CS code-behind file to define client logic. Windows Phone 8 Solution Anatomy 72 6. Getting Started Windows phone 8 Main page Designer area Code Behind area XAML Page area 73 6. Getting Started Windows phone 8 The XAP file is simply a compressed file, like a ZIP file, that contains all the files needed to execute the application. This file is created automatically by Visual Studio and placed under the \bin directory. 74 6. Getting Started Windows phone 8 Running Applications from Visual Studio By default, you run your Windows Phone 8 application in Visual Studio using the emulator. The emulator lets you run an application directly from your PC desktop without a physical device. If you have a Windows Phone 8 device plugged in to your computer via USB cable, you can run the application directly on the device. 75 6. Getting Started Windows phone 8 Using the Emulator The emulator simulates Windows 8 Phone applications running in three screen sizes: WVGA- 800 × 480pixels. An additional 512MB RAM version of WVGA allows you to emulate memory-constrained devices. WXGA- 1280 × 768pixels. 720p- 1280 × 720pixels. 76 6. Getting Started Windows phone 8 Using the Emulator 77 6. Getting Started Windows phone 8 Using the Emulator Additional Tools Accelerometer tab 78 6. Getting Started Windows phone 8 Using the Emulator Additional Tools Location tab 79 6. Getting Started Windows phone 8 Using the Emulator Additional Tools Screenshot tab 80 6. Getting Started Windows phone 8 Using the Emulator Additional Tools Network tab 81 6. Getting Started Windows phone 8 Register real phone for development Prerequisites The first is registering as a developer at Next, register your phone device to “unlock” the phone for development. The phone must have a cell or Wi-Fi connection. The USB connection alone is not enough. 82 6. Getting Started Windows phone 8 Prerequisites 1. Turn on the phone and unlock the screen. 2. Verify the date and time on the phone. The Settings app lets you configure the date and time for the phone. Typically, this will be synced automatically with the correct date and time. 3. Connect the phone device USB to the development PC. 4. On the development PC, navigate to the Startscreen, type “Windows Phone Developer Registration” to search for the registration application, and click the entry in the Apps list to run it 83 6. Getting Started Windows phone 8 Prerequisites 5. In the Windows Phone Developer Registration screen, verify the Status message. The Status will indicate if the phone is ready to be registered and will flag any problems, such as your device is unconnected, before continuing. 6. Click the Register button 84 6. Getting Started Windows phone 8 Prerequisites 85 6. Getting Started Windows phone 8 Prerequisites 7. Sign in with your Windows Live ID connected to your registered developer’s account. 8. Check the Statusagain to verify you have successfully unlocked your Windows Phone Well done, now you can deploy Windows Phone 8 applications directly onto the phone! 86 7. Application LifeCycle 87 7. Application LifeCycle Not running Running Launching Running 88 7. Application LifeCycle Not running Running Launching Closing Deactivating Dormant Exit Application_Closing Deactivate Application_Deactivated Closing vs Deactivating Dormant 89 7. Application LifeCycle Not running Running Launching Closing Deactivating Activating Dormant Dormant Application instance in memory Application state, data, objects remain intact App must prepare to be closed (no code can run in dormant state) 90 7. Application LifeCycle Tombstoned Not running Running Launching Closing Deactivating Activating Dormant Tombstoned From Dormant to Tombstone is memory based Application state dictionaries, navigation saved Data must be restored 91 7. Application LifeCycle Tombstoned Not running Running Launching Closing Deactivating Activating Dormant Tombstoned or Dormant? private void Application_Activated(object sender, ActivatedEventArgs e) { if (e.IsApplicationInstancePreserved) { // Dormant - objects in memory intact } else { // Tombstoned - need to reload } } 92 7. Application LifeCycle Fast Application Resume Tombstoned Not running Running Launching Closing Deactivating Activating Dormant reactivates a dormant application if the user launches a new instance added to enable background location tracking, but we can use it to activate a dormant application instead of launching a new instance 93 7. Application LifeCycle Enabling FAR in Properties\WMAppManifest.xml 94 7. Application LifeCycle Why Not Use FAR All The Time? Normal App Navigation Launch from Start Page 1 Page 2 Launch from Start Page 2 deep link 95 7. Application LifeCycle Why Not Use FAR All The Time? Fast Application Resume Launch from Start Page 1 Page 2 Launch from Start Page 2 FAR Page 1 96 7. Application LifeCycle 97 7. Application LifeCycle // Code to execute when the application is launching (eg, from Start) // This code will not execute when the application is reactivated private void Application_Launching(object sender, LaunchingEventArgs e) { } // Code to execute when the application is activated (brought to foreground) // This code will not execute when the application is first launched private void Application_Activated(object sender, ActivatedEventArgs e) { } // Code to execute when the application is deactivated (sent to background) // This code will not execute when the application is closing private void Application_Deactivated(object sender, DeactivatedEventArgs e) { } // Code to execute when the application is closing (eg, user hit Back) // This code will not execute when the application is deactivated private void Application_Closing(object sender, ClosingEventArgs e) { } 98 8. Taking Your App to Market Certification Requirements for Windows Phone Store Using the Store Test Kit Submitting Your App to the Windows Phone Store 99 8. Taking Your App to Market Certification Requirements for Windows Phone Store The requirements listed at the App certification requirements for Windows Phonepage ( ) App policies for Windows Phone ( ) Content policies for Windows Phone ( ) 100 8. Taking Your App to Market Certification Requirements for Windows Phone Store App submission requirements for Windows Phone ( ) Technical certification requirements for Windows Phone ( ) Additional requirements for specific app types for Windows Phone ( ) 101 8. Taking Your App to Market Using the Store Test Kit In the Visual Studio Solution Explorer, right-click the project node to execute the Open Store Test Kit option from the context menu 102 8. Taking Your App to Market 103 8. Taking Your App to Market Automated Tests 104 8. Taking Your App to Market Manual Tests 105 8. Taking Your App to Market Submitting Your App to the Windows Phone Store Please see the link: END 106
File đính kèm:
- 1 - INTRODUCTION WINDOWS PHONE OS (3t).pptx