OBJECTIVE 3 3 Use a Mobile Application Development Environment
3.5 Code for mobile applications
Understand design for mobile devices 21
understanding general software development 3.1
UNDERSTAND DESIGN FOR MOBILE DEVICES
SCENARIO: Maggie Carrido has an internship at Contoso Pharmaceuticals. Until she proves to her manager that she is ready to work with the development team, Maggie is working on some design issues for an application that the company is considering developing.
They would like to create a Windows Phone® application that would provide up-to-date information from the company’s production plant. Their products are produced in large batches, so they want the sales team to know what quantities will be available, as well as the date that each batch will be ready for shipment. The application will be free of charge, but it will require an employee logon and password to access any data.
1.
How can the team distribute the application so that employees can install it?a. By emailing the binary file to each employee b. By using a web installer on the company’s website c. By submitting it to the Windows Phone Marketplace
2.
What visual style should the application implement to be consistent with other Windows Phone applications?a. Aero b. Metro
c. Windows Forms
3.
Which process includes translating strings into other languages?a. Marketplace submission b. Globalization
c. Localization Globalization and
localization enable an application to be marketed in other countries.
OBJECTIVE
use a mobile application development environment 3.1A
22 OBJECTIVE 3: Use a Mobile Application Development Environment
Answers
1.
How can the team distribute the application so that employees can install it?c. By submitting it to the Windows Phone Marketplace. This is the only supported method for installing a Silverlight® or XNA® application for non-development purposes.
2.
What visual style should the application implement to be consistent with other Windows Phone applications?b. Metro
3.
Which process includes translating strings into other languages?c. Localization. Globalization refers to separating language-specific user interface (UI) elements from the code; neither localization nor globalization is necessary for Marketplace submission.
Essential details
• Windows Phone Marketplace is the centralized service where developers can sell (or give away) applications and games for Windows Phone devices.
• To be available in the Marketplace, applications and games must pass a submission and certification process to ensure that, among other things, it is reliable, efficient, and free of malicious code.
• The Windows Phone OS user experience is based on the Metro visual style; applications for Windows Phone OS also should implement the Metro style. It features a clean, simple style that favors content over decoration.
• In a mobile application, UI controls should be big enough to ensure touch accuracy and should use spacing or padding.
• Globalization and localization help developers target a variety of markets around the world. Globalization refers to making an application as language-neutral as possible. Localization means making the application responsive to the users’ region and language settings so that the UI appears in their local language.
FAST TRACK HELP
• Application Certification Requirements for Windows Phone http://msdn.microsoft.com/en-us/library/hh184843(v=VS.92).aspx
• Globalization and Localization for Windows Phone
http://msdn.microsoft.com/en-us/library/ff637522(v=VS.92).aspx
• User Experience Design Guidelines for Windows Phone
http://msdn.microsoft.com/en-us/library/hh202915%28v=VS.92%29.aspx
Understand design for mobile devices 23
understanding general software development 3.1
UNDERSTAND DESIGN FOR MOBILE DEVICES
SCENARIO:Maggie Carrido has impressed her manager at Contoso Pharmaceuticals by working out some basic design details for an application that interacts with data from the company’s production plant. The application will retrieve and display information about inventory, current production runs, and future production schedules.
Because she is going to have the chance to work on the development team, she will need to learn more about the models that developers rely on when building applications.
1.
Which design pattern separates the user interface (UI) from the database?a. MVVM b. OOP c. WCF
2.
Which of the following is an important concept in OOP?a. A clean, simple UI
b. Storing data in a remote database accessible via the Internet c. Encapsulating properties and methods in classes
3.
Which technique enables multiple tasks to be processed at the same time?a. Asynchronous programming b. Inheritance
c. LINQ to SQL
MVVM stands for Model-View-ModelView; OOP stands for object-oriented programming.
OBJECTIVE
use a mobile application development environment 3.1B
24 OBJECTIVE 3: Use a Mobile Application Development Environment
Answers
1.
Which design pattern separates the user interface (UI) from the database?a. MVVM
2.
Which of the following is an important concept in OOP?c. Encapsulating properties and methods in classes
3.
Which technique enables multiple tasks to be processed at the same time?a. Asynchronous programming
Essential details
• The two most important factors in application performance are startup time and responsiveness to the user.
• MVVM is a design pattern that separates the database contents (or data access layer) from the user interface.
It is particularly useful in database applications.
• OOP is a development approach that is supported by a variety of programming languages, including Microsoft Visual Basic® and Microsoft Visual C#®.
• Three important concepts in OOP are encapsulation, inheritance, and polymorphism.
• Encapsulation refers to grouping properties and methods together.
• Inheritance is the ability to create new classes based on (or “extending”) existing classes.
FAST TRACK HELP
• Performance Considerations in Applications for Windows Phone http://msdn.microsoft.com/en-us/library/ff967560(v=VS.92).aspx
• Object-Oriented Programming (C# and Visual Basic) http://msdn.microsoft.com/en-us/library/dd460654.aspx
• Getting Started with the MVVM Pattern in Silverlight Applications http://weblogs.asp.net/dwahlin/archive/2009/12/08/
getting-started-with-the-mvvm-pattern-in-silverlight-applications.aspx FAST TRACK HELP
_____ / 3
Track Your Score
TRAINING
Network for mobile devices 25
understanding general software development 3.1
NETWORK FOR MOBILE DEVICES
SCENARIO:Virginie Jean has worked in the IT department at Consolidated Messenger for several years. She is responsible for maintaining workstations and servers in the company headquarters. She became interested in mobile applications and is learning to program in Microsoft Visual C#®. Virginie’s supervisor is happy to see her working on new skills and has offered to allow Virginie spend a few hours each week shadowing the development team.
The team is preparing to submit an application to the Windows Phone® Marketplace. The application provides customers with up-to-date shipping information, including notifi cations when shipment details are updated.
Virginie doesn’t understand how the application does everything, but she’s very interested in the way it connects to the company’s web-based server.
1.
When a customer’s package is shipped, the application shows an alert in a small bar at the top of the Windows Phone device’s screen. What type of notification is this?a. Raw notification b. Tile notification c. Toast notification
2.
When a package is shipping to a large company, employees of that companycan sign up to receive updates; however, the server seems to send the data only once.
What technology is the application likely using to do this?
a. Multicast
b. Rich Internet Application (RIA) c. .xap files
3.
One of the developers mentioned that for normal use, the application requires no special functionality on the server side—it simply connects to the company’s website.What tools are likely being used to do this?
a. Multicast b. SQL Replication c. Web services
Raw, tile, and toast notifi cations are all types of push notifi cations.
OBJECTIVE
use a mobile application development environment 3.2
26 OBJECTIVE 3: Use a Mobile Application Development Environment
Answers
1.
When a customer’s package is shipped, the application shows an alert in a small bar at the top of the Windows Phone device’s screen. What type of notification is this?c. Toast notification
2.
When a package is shipping to a large company, employees of that company can sign up to receive updates; however, the server seems to send the data only once. What technology is the application likely using to do this?a. Multicast
3.
One of the developers mentioned that for normal use, the application requires no special functionality on the server side—it simply connects to the company’s website. What tools are likely being used to do this?c. Web services
Essential details
• Push notifications allow a web service to send data to a Windows Phone device.
• Tile notifications can update Tiles on the device’s Start screen.
• Toast notifications appear at the top of the screen.
• Raw notifications go directly to an application and may not notify the user.
• RIAs are web-based applications that feature user interfaces such as animation, multimedia, and interactivity.
• Silverlight® applications are distributed in application packages with the .xap (pronounced “zap”) extension.
FAST TRACK HELP
• Application and Programming Models
http://msdn.microsoft.com/en-us/library/cc903934(v=VS.95).aspx
• Networking and Web Services Overview for Windows Phone http://msdn.microsoft.com/en-us/library/ff637518(v=VS.92).aspx
• Push Notifications Overview for Windows Phone
http://msdn.microsoft.com/en-us/library/ff402558(v=VS.92).aspx FAST TRACK HELP
_____ / 3
Track Your Score
TRAINING
Understand silverlight 27
understanding general software development 3.1
UNDERSTAND SILVERLIGHT
SCENARIO:Jenny Liu is applying for a job as a Level 1 developer at Fabrikam, Inc. The company is starting a new department to develop applications for Windows Phone® devices, and Jenny is hoping to be part of the new team. Fabrikam’s “Help Wanted” notice states that recently trained developers are encouraged to apply and that the team will be developing applications using Silverlight for Windows Phone, but they will be moving to XNA® in a few months.
Jenny has never used Silverlight®, but she took a class on XNA when she was in college and she has some experience with creating Windows® Forms applications in Microsoft Visual Basic®. She has learned several things in her recent search for information about Windows Phone development.
1.
Jenny’s experience with Windows Forms user interfaces (UIs) is most likely to help her with which technology?a. HTML5
b. Silverlight c. XNA
2.
Which technology is a good choice for a 3-D game?a. HTML5
b. Silverlight c. XNA
3.
Which technology uses a frame loop, rather than an event-driven model?a. HTML5
b. Silverlight c. XNA
In many ways, Silverlight is similar to Windows Presentation Foundation (WPF).
OBJECTIVE
use a mobile application development environment 3.3A
28 OBJECTIVE 3: Use a Mobile Application Development Environment
Answers
1.
Jenny’s experience with Windows Forms user interfaces (UIs) is most likely to help her with which technology?b. Silverlight. Like Windows Forms, Silverlight provides many user interface controls and uses an event-driven execution model.
2.
Which technology is a good choice for a 3-D game?c. XNA. XNA is clearly optimized for games and simulations. It allows you to use models, textures, sprites, and pixel shaders when rendering graphics.
3.
Which technology uses a frame loop rather than an event-driven model?c. XNA. XNA is based on a frame loop and is ideal for games and simulations.
Essential details
• Developers can create managed Windows Phone applications in either XNA or Silverlight; Windows Phone is also capable of running HTML5 web applications.
• XNA is geared toward game development, and Silverlight typically works well for UI-based applications.
However, this may not always be true; many developers also create games using Silverlight.
• Silverlight is similar to WPF and relies on Extensible Application Markup Language (XAML) to implement a UI.
• Silverlight applications use an event-driven model, while XNA applications use a frame loop and “polling.”
• Silverlight excels at integrating video and other multimedia elements into applications; XNA is capable of rending full 3-D games.
• It is possible to create and application that uses both technologies.
FAST TRACK HELP
• The Silverlight and XNA Frameworks for Windows Phone
http://msdn.microsoft.com/en-us/library/ff402528(v=VS.92).aspx
• Windows Phone Developer Guide—Appendix B
http://msdn.microsoft.com/en-us/library/gg490774.aspx
• Building Apps with HTML5: What You Need to Know
http://msdn.microsoft.com/en-us/magazine/hh335062.aspx FAST TRACK HELP
_____ / 3
Track Your Score
TRAINING
Understand silverlight 29
understanding general software development 3.1
UNDERSTAND SILVERLIGHT
SCENARIO: Jenny Liu has applied for a job as a Level 1 Developer at Fabrikam, Inc. Her fi rst interview went well—the project manager was impressed with Jenny’s knowledge of Silverlight® and is interested in hiring her to be a part of that team. The team will be building a weather application that will allow the user to scroll to see forecasts for up to 10 days into the future.
As the last step of the hiring process, the manager asks Jenny some questions about the different controls available when developing a Windows Phone® application with the Silverlight framework.
1.
Which Windows Phone control is intended to display simple text, without allowing the user to edit the information?a. Label b. TextBlock c. TextBox
2.
Which of the following built-in applications demonstrates the use of a Pivot control?a. Bing® Maps b. Email c. Messaging
3.
Which control provides a large horizontal surface that extends beyond the edges of the display?a. Canvas b. Panorama c. Pivot
OBJECTIVE
use a mobile application development environment 3.3B
Windows Phone
applications can use most of the standard Silverlight controls.
30 OBJECTIVE 3: Use a Mobile Application Development Environment
Answers
1.
Which Windows Phone control is intended to display simple text, without allowing the user to edit the information?b. TextBlock. Windows Phone does not support the Label control; TextBox is intended to allow user input.
2.
Which of the following built-in applications demonstrates the use of a Pivot control?b. Email. Other examples include the Calendar and Settings applications.
3.
Which control provides a large horizontal surface that extends beyond the edges of the display?b. Panorama.
Essential details
• Controls are the visible elements that make up a user interface, such as Buttons and TextBoxes. Many of these are slightly different from the standard desktop controls, so that they work well with the Windows Phone touch display.
• Silverlight for Windows Phone supports most of the standard Silverlight controls, plus the Panorama and Pivot controls.
• The Panorama control is used to display related content on a long horizontal canvas that extends beyond the confines of the screen. Examples of the Panorama control include the built-in people and pictures app hubs.
• The Pivot control is used to switch between different views of the same data or application. It is similar in function to a tab control in a desktop or web application. Built-in examples of the Pivot control include the email and calendar applications.
FAST TRACK HELP
• Controls in Silverlight for Windows Phone
http://msdn.microsoft.com/en-us/library/ff426932(v=VS.95).aspx
• Panorama and Pivot Controls Quickstart
http://create.msdn.com/en-US/education/quickstarts/
Panorama_and_Pivot_Controls
• Types of Controls
http://create.msdn.com/en-US/education/quickstarts/Types_of_Controls FAST TRACK HELP
_____ / 3
Track Your Score
TRAINING
Work with developer tools 31
understanding general software development 3.1
WORK WITH DEVELOPER TOOLS
SCENARIO:Tad Orman is a recent university graduate and works at Humongous Insurance as a junior member of one of the company’s software development teams. Most of Tad’s experience has been with Java and C++, but due to his hard work, the manager of Humongous Insurance’s mobile applications group has requested that Tad join her team.
The manager of that team asked Tad to set up his workstation for mobile application development and loaned him a Windows Phone device to try creating and deploying some simple applications. If Tad learns quickly and enjoys the work, he will move over to the new team.
1.
What does Tad need to install to ensure that he has all the development tools for Windows Phone® applications?a. Microsoft Visual Studio® 2010 Professional b. Windows Phone Emulator
c. Windows Phone SDK
2.
If the development tools are installed on a computer without an existing Visual Studio installation, what integrated development environment (IDE) will the developer use?a. Silverlight for Windows Phone
b. Visual Studio 2010 Express for Windows Phone c. Visual Studio 2010 Professional
3.
Which testing configuration locks the media files, preventing access to some of the Windows Phone functionality?a. Connecting a physical device with the Windows Phone Connect tool b. Connecting a physical device with the Zune® software
c. Using the Windows Phone Emulator
OBJECTIVE
use a mobile application development environment 3.4
The Windows Phone emulator provides a desktop application that mimics a Windows Phone device.
32 OBJECTIVE 3: Use a Mobile Application Development Environment
FAST TRACK HELP
• Visual Studio 2010 Express for Windows Phone
http://msdn.microsoft.com/en-us/library/ff630878(v=VS.92).aspx
• Windows Phone Emulator
http://msdn.microsoft.com/en-us/library/ff402563(v=VS.92).aspx
• Deploying and Testing on You Windows Phone
http://msdn.microsoft.com/en-us/library/gg588378(v=VS.92).aspx FAST TRACK HELP
_____ / 3
Track Your Score
TRAINING
Answers
1.
What does Tad need to install to ensure that he has all the development tools for Windows Phone applications?c. Windows Phone SDK. This can be downloaded for free at http://create.msdn.com.
2.
If the development tools are installed on a computer without an existing Visual Studio installation, what integrated development environment (IDE) will the developer use?b. Visual Studio 2010 Express for Windows Phone. Computers with Visual Studio 2010 Professional (or later) will get the Windows Phone add-in, allowing developers to use the previously installed IDE.
3.
Which testing configuration locks the media files, preventing access to some of the Windows Phone functionality?b. Connecting a physical device with the Zune software. The Windows Phone Connect tool allows you to connect without running Zune.
Essential details
• An integrated development environment (IDE), is a collection of tools and resources for developing applications. The IDE used by Windows Phone developers is Visual Studio.
• The Windows Phone SDK installs all the various tools necessary for creating, testing, and publishing Windows Phone applications.
• An important component of the Windows Phone SDK is the Windows Phone Emulator. This application allows developers to test a Windows Phone application right on their development computer, without the need for an actual Windows Phone device.
Code for mobile applications 33
CODE FOR MOBILE APPLICATIONS
SCENARIO:Tad Orman wants to show the manager of the mobile applications development team at Humongous Insurance that he understands the fundamentals of writing code for Windows Phone® applications. Though most of his prior experience is with C++ and Java, Tad has installed the Windows Phone SDK. Now he wants to try creating some Windows Phone applications, and he knows that he has some choices to make about which programming languages and technologies he can use.
1.
Which language is likely to be more familiar to Tad, given his programming background?a. HTML5
b. Microsoft Visual Basic® c. Microsoft Visual C#
2.
Tad’s first application will not execute due to errors. What type of errors is Tad experiencing?a. Build errors b. Rendering errors c. Run-time errors
3.
Which technology is ideal for creating a fast-paced arcade game with Visual Basic?a. HTML5 b. XAML c. XNA®
OBJECTIVE
use a mobile application development environment 3.5
XAML stands for Extensible Application Markup Language. It is syntactically similar to XML and HTML.
34 OBJECTIVE 3: Use a Mobile Application Development Environment
Answers
1.
Which language is likely to be more familiar to Tad, given his programming background?c. Microsoft Visual C#. The syntax used in C# is very similar to the syntax used in C/C++.
2.
Tad’s first application will not execute due to errors. What type of errors is Tad experiencing?a. Build errors.
3.
Which technology is ideal for creating a fast-paced arcade game with Visual Basic?c. XNA. XNA is specifically designed for developing games.
Essential details
• Application errors are generally categorized as either build errors or run-time errors. Build errors prevent
• Application errors are generally categorized as either build errors or run-time errors. Build errors prevent