SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
Fundamental Concepts for
Building a Windows Phone 7 App

 Presented by Jeff Smoley, Software Architect @ W3i
 Jeff.Smoley@w3i.com
The Win Phone 7 Language



 Silverlight
 C#, VB .Net
 XAML
 XNA
Tools



 Tools are free – App Hub
 Visual Studio 2010 Express For Windows Phone
 Expression Blend 4 for Windows Phone
 Silverlight Toolkit – CodePlex
    Download the Silverlight for Windows Phone Toolkit
Resources



 App Hub
 Windows Phone Development – MSDN
 Fundamental Concepts for Windows Phone – MSDN
 Good Old F1 with-in Visual Studio
Execution Model
• Execution Model Overview for
  Windows Phone – MSDN
• No need to restore state when
  app is reactivated when
  returning from Dormant state.
• IsApplicationInstancePerserved
     • True = Dormant
     • False = Tombstoned
Frame and Page
Navigation
• Frame and Page Navigation
  Overview for Windows Phone
  – MSDN
• Frame
     • Is where pages are
       rendered.
     • Exposes properties
       from a hosted page
       such as screen
       orientation.
     • Exposes
       NavigationService.
     • Reserves space for
       Application Bar and
       Status Bar.
Application
Page Model
• Application Page Model for
  Windows Phone – MSDN
• A Page is a user-recognizable
  collection of persistent state.
• A Screen is a something such
  as a pop-up window, dialog
  box or splash screen and
  does not contain memorable
  content.
• Pages can communicate
  through simple Querystrings.
  Complex objects need to be
  persisted and restored from
  page to page.
• Need to manage Backstack to
  make sure user navigation
  makes sense.
• NavigationService.BackStack
• NavigationService.RemoveBa
  ckEntry
Orientation

 How to: Handle Orientation Changes on Windows Phone
  – MSDN
 Like most mobile devices Windows Phone supports both
  Portrait and Landscape orientations.
 You need to set the supported orientation(s) on each
  page by setting the Orientation property through XAML
  or Code.
 There are different strategies to handle orientations.
  Some out of the box support if you use Stack Panels and
  Scroll Views.
 Alternatively you can handle the OrientationChanged
  event and adjust your layout accordingly.
Windows Phone Project Types




          DEMO
Page Layout



 Grid
 StackPanel
 Canvas
 WrapPanel
    Part of Silverlight Toolkit
 Others
Grid

 Default container used when using a basic Phone
  template.
 You define Columns and Rows to place other controls
  into.
 Cells can be fixed size or have the ability to float.
     Auto – Adjusts the cells size based on the content contained
      with-in.
     Star Sizing (*) – Indicates that the cell should take the
      remaining space available in the row or column. If you have
      multiple cells with asterisks you can proceed the asterisk
      with a number (example 3*) to weight each one against the
      others.
StackPanel


 Controls are stacked upon each other.
 Can set the Orientation property to either Horizontal or
  Vertical.
 If the StackPanel contains more items than can be
  displayed in the view port they will be cropped.
 Can wrap the StackPanel with a ScrollViewer to allow the
  user to scroll to see items outside the view port.
Canvas




 Coordinate based layout using offests, Left and Top, to
  position controls with-in the Canvas.
 Position 0,0 is Upper Left corner, unless of course your
  FlowDirection property is set to RightToLeft.
WrapPanel




 Works like the StackPanel except when items reach the
  edge they won’t be cropped but instead wrapped to the
  next row or column (depending on the Orientation).
Dependency Properties


 Dependency Property Overview – MSDN
 Applies to WPF and Silverlight.
 A special property that uses a dictionary as a backing
  store that keeps track of values across all instances of a
  particular type.
 A hierarchical relationship is built between the values.
 Reduces memory foot print.
 Mechanism built in to notify when a value is changed.
Dependency Properties – Cont.


 They are often used in XAML and provide a similar
  experience to how CSS works for HTML.
 Allows you to specify a value at different levels:
     Application Resources
     Page/User Control Resources
     Control Resources
     Direct Properties on the Control
Attached Properties



 Attached Properties Overview – MSDN
 Are typically a special type of Dependency Property.
 Are used as a way to relate controls to each other.
 You essential are registering the control you want to
  Attach using the property on the control you want to
  attach to.
Setting Properties in XAML

 There are two ways to set properties in XAML:
     Attributes
     Elements

 Attributes can only accept string input.
 Certain Attributes have Type converters that can take
  structured strings, example being Margin where you define
  the thickness of each side of the box separated by commas.
 There are certain properties whose values can’t be
  expressed with a simple textual value. In these cases you
  can set them using the Element syntax. All properties can
  be set this way but if you can set them using the Attribute
  syntax there isn’t much value in using the Element syntax.
Data Storage


 Isolated Storage Overview for Windows Phone – MSDN
 Three main ways to store data:
    Settings: Store data as key/value pairs by using the
     IsolatedStorageSettings class.
    Files and folders: Store files and folders by using the
     IsolatedStorageFile class.
    Relational data: Store relational data in a local database by
     using LINQ to SQL.
Relational Data


 Uses SQL Server Compact Edition
 Use LINQ to SQL to work with database.
 Scheme is managed through decorating classes with
  special Attributes.
    Table
    Column
    Assocation
Relational Data – Cont.


 Adding a version column to your tables significantly
  improves update performance.
   
 If you plan to do read-only queries, after creating the
  DataContext set the ObjectTrackingEnabled property to
  false. This will improve performance as changes to
  objects wont be tracked.
Relational Data – Versioning


 You check your database version using the
  DatabaseSchemeUpdater class.
 You also use this class to submit scheme changes.
 Can only make Additive changes.
 If you need to make complex scheme changes you need
  to create a new database and migrate the data from the
  old scheme to the new scheme.
 Refer to Changing the Database Scheme section in this
  link for examples.
Relational Data – Shipping DB
 How to: Deploy a Reference Database with a Windows
  Phone Application – MSDN
 In order to prepopulate a database with data you can either
  insert the data when the app starts or build a separate app
  to generate the database scheme and populate it with data.
 Once populated you Use the Isolated Storage Explorer Tool
  to extract the database file from your device or emulator.
 You add the DB as an existing item to your project and
  mark its Build Action to Content under the File Properties.
 When deployed the file will live in the Reference Storage on
  the device in a Read-Only state. Must copy to Isolated
  Storage if you want to modify scheme or data.
Relational Data – Best Practices




 Local Database Best Practices for Windows Phone –
  MSDN
Device Theme Settings
 Themes for Windows Phone – MSDN
 When your app loads it takes a snapshot of the curremt Theme that
  is setup for the device.
     Background
     Accent Color
 Make sure to test your app by changing these Theme settings to
  make sure you app looks ok. Particularly the Background colors.
 To apply the Accent Color in XAML you use the "{StaticResource
  PhoneAccentBrush}"
     In code you use
      (Color)Application.Current.Resources["PhoneAccentColor"]
 To determine the Background setting from code you use:
     (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"
      ] == Visibility.Visible
Tips, Trick, & Mango
 Hitting the Break key will enable the PC Keyboard in the
  Emulator.
 Mango added some new Advanced Features to the
  Emulator.
    Accelerometer
    Location (Map)
    Screenshots
 There’s a way to enable more than one Emulator.
 Long Press of Back button will bring up Application
  Switching.
 Only 30 Apps can register push notifications at one time.
Tips, Trick, & Mango – Cont.

 You can test Tombstoning by going into the Projects
  Properties -> Debug tab and checking the box there.
 A new menu item under Debug called Windows Phone
  Performance Analysis.
 The WMAppManifest.xml file must contain a request for
  each Capability it needs access to by adding an entry
  into the Capabilities element.
    Things such as Contacts, Locations, Appointments, etc.
    By Default all capabilities are added, remove the items you
     don’t need.
Tips, Trick, & Mango – Cont.
 Mango added support for a Front and Back Live Tile.
    In general, Tiles flip at regular intervals with each visible tile
     having a different 'start' time. (...because it looks better
     than all tiles flipping at the same time.)
    Also, Tile flipping is suspended when the phone enters User
     Idle state, to save battery life, but will restart once the user
     starts using the phone again.
 Live Tiles and Toaster notifications can now Deep Link
  into the app.
    Can go to a specific page using Querystirng parameters.
    You can now create multiple Live Tiles per App using this
     technique.
        For Example, Pinning individual People on your Start Page.
Tips, Trick, & Mango – Cont.


 Mango added better networking support including
  support for Sockets.
 Mango also added support for Background Agents, better
  Multitasking.
 Multitasking for Windows Phone - MSDN
 Background Agents Overview for Windows Phone -
  MSDN
Tips, Trick, & Mango – Cont.

 Visual Studio has a Market Place Test Kit that allows you
  to verify your App is Ready for submission.
 In VS goto Project -> Open Market Place Test Kit
 It helps make sure you have all your App Details setup.
 Can run through the same Automated Tests the MS runs
  on their end.
 Can also run through their Manual Test too.
 Passing these tests will greatly improve your chance of
  getting your app approved. You can resolve the majority
  of the issues and minimize the back and forth overhead.
App Submission

 100 free app submissions a year.
    Failed submissions and updates count towards this number.
    $20 to increase the limit.
 Paid apps can have a trial version.
    No need for a Lite version.
    API in code for checking this mode to branch your logic.
 Can do beta testing with up to 100 testers.
    Private link sent via e-mail.
    90 days to test and provide feedback.
Wrapping Up

 Resources
    App Hub
        http://create.msdn.com

    Windows Phone Development
        http://msdn.microsoft.com/en-us/library/ff402535(v=vs.92).aspx

    Fundamental Concepts for Windows Phone
        http://msdn.microsoft.com/en-us/library/ff967549(v=VS.92).aspx

    Mango Jump Start
        http://channel9.msdn.com/Series/Mango-Jump-Start

 Contact
    Jeff.Smoley@w3i.com

Contenu connexe

Dernier

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Dernier (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Fundamental Concepts for Building a Windows Phone 7 App

  • 1. Fundamental Concepts for Building a Windows Phone 7 App Presented by Jeff Smoley, Software Architect @ W3i Jeff.Smoley@w3i.com
  • 2. The Win Phone 7 Language  Silverlight  C#, VB .Net  XAML  XNA
  • 3. Tools  Tools are free – App Hub  Visual Studio 2010 Express For Windows Phone  Expression Blend 4 for Windows Phone  Silverlight Toolkit – CodePlex  Download the Silverlight for Windows Phone Toolkit
  • 4. Resources  App Hub  Windows Phone Development – MSDN  Fundamental Concepts for Windows Phone – MSDN  Good Old F1 with-in Visual Studio
  • 5. Execution Model • Execution Model Overview for Windows Phone – MSDN • No need to restore state when app is reactivated when returning from Dormant state. • IsApplicationInstancePerserved • True = Dormant • False = Tombstoned
  • 6. Frame and Page Navigation • Frame and Page Navigation Overview for Windows Phone – MSDN • Frame • Is where pages are rendered. • Exposes properties from a hosted page such as screen orientation. • Exposes NavigationService. • Reserves space for Application Bar and Status Bar.
  • 7. Application Page Model • Application Page Model for Windows Phone – MSDN • A Page is a user-recognizable collection of persistent state. • A Screen is a something such as a pop-up window, dialog box or splash screen and does not contain memorable content. • Pages can communicate through simple Querystrings. Complex objects need to be persisted and restored from page to page. • Need to manage Backstack to make sure user navigation makes sense. • NavigationService.BackStack • NavigationService.RemoveBa ckEntry
  • 8. Orientation  How to: Handle Orientation Changes on Windows Phone – MSDN  Like most mobile devices Windows Phone supports both Portrait and Landscape orientations.  You need to set the supported orientation(s) on each page by setting the Orientation property through XAML or Code.  There are different strategies to handle orientations. Some out of the box support if you use Stack Panels and Scroll Views.  Alternatively you can handle the OrientationChanged event and adjust your layout accordingly.
  • 10. Page Layout  Grid  StackPanel  Canvas  WrapPanel  Part of Silverlight Toolkit  Others
  • 11. Grid  Default container used when using a basic Phone template.  You define Columns and Rows to place other controls into.  Cells can be fixed size or have the ability to float.  Auto – Adjusts the cells size based on the content contained with-in.  Star Sizing (*) – Indicates that the cell should take the remaining space available in the row or column. If you have multiple cells with asterisks you can proceed the asterisk with a number (example 3*) to weight each one against the others.
  • 12. StackPanel  Controls are stacked upon each other.  Can set the Orientation property to either Horizontal or Vertical.  If the StackPanel contains more items than can be displayed in the view port they will be cropped.  Can wrap the StackPanel with a ScrollViewer to allow the user to scroll to see items outside the view port.
  • 13. Canvas  Coordinate based layout using offests, Left and Top, to position controls with-in the Canvas.  Position 0,0 is Upper Left corner, unless of course your FlowDirection property is set to RightToLeft.
  • 14. WrapPanel  Works like the StackPanel except when items reach the edge they won’t be cropped but instead wrapped to the next row or column (depending on the Orientation).
  • 15. Dependency Properties  Dependency Property Overview – MSDN  Applies to WPF and Silverlight.  A special property that uses a dictionary as a backing store that keeps track of values across all instances of a particular type.  A hierarchical relationship is built between the values.  Reduces memory foot print.  Mechanism built in to notify when a value is changed.
  • 16. Dependency Properties – Cont.  They are often used in XAML and provide a similar experience to how CSS works for HTML.  Allows you to specify a value at different levels:  Application Resources  Page/User Control Resources  Control Resources  Direct Properties on the Control
  • 17. Attached Properties  Attached Properties Overview – MSDN  Are typically a special type of Dependency Property.  Are used as a way to relate controls to each other.  You essential are registering the control you want to Attach using the property on the control you want to attach to.
  • 18. Setting Properties in XAML  There are two ways to set properties in XAML:  Attributes  Elements  Attributes can only accept string input.  Certain Attributes have Type converters that can take structured strings, example being Margin where you define the thickness of each side of the box separated by commas.  There are certain properties whose values can’t be expressed with a simple textual value. In these cases you can set them using the Element syntax. All properties can be set this way but if you can set them using the Attribute syntax there isn’t much value in using the Element syntax.
  • 19. Data Storage  Isolated Storage Overview for Windows Phone – MSDN  Three main ways to store data:  Settings: Store data as key/value pairs by using the IsolatedStorageSettings class.  Files and folders: Store files and folders by using the IsolatedStorageFile class.  Relational data: Store relational data in a local database by using LINQ to SQL.
  • 20. Relational Data  Uses SQL Server Compact Edition  Use LINQ to SQL to work with database.  Scheme is managed through decorating classes with special Attributes.  Table  Column  Assocation
  • 21. Relational Data – Cont.  Adding a version column to your tables significantly improves update performance.   If you plan to do read-only queries, after creating the DataContext set the ObjectTrackingEnabled property to false. This will improve performance as changes to objects wont be tracked.
  • 22. Relational Data – Versioning  You check your database version using the DatabaseSchemeUpdater class.  You also use this class to submit scheme changes.  Can only make Additive changes.  If you need to make complex scheme changes you need to create a new database and migrate the data from the old scheme to the new scheme.  Refer to Changing the Database Scheme section in this link for examples.
  • 23. Relational Data – Shipping DB  How to: Deploy a Reference Database with a Windows Phone Application – MSDN  In order to prepopulate a database with data you can either insert the data when the app starts or build a separate app to generate the database scheme and populate it with data.  Once populated you Use the Isolated Storage Explorer Tool to extract the database file from your device or emulator.  You add the DB as an existing item to your project and mark its Build Action to Content under the File Properties.  When deployed the file will live in the Reference Storage on the device in a Read-Only state. Must copy to Isolated Storage if you want to modify scheme or data.
  • 24. Relational Data – Best Practices  Local Database Best Practices for Windows Phone – MSDN
  • 25. Device Theme Settings  Themes for Windows Phone – MSDN  When your app loads it takes a snapshot of the curremt Theme that is setup for the device.  Background  Accent Color  Make sure to test your app by changing these Theme settings to make sure you app looks ok. Particularly the Background colors.  To apply the Accent Color in XAML you use the "{StaticResource PhoneAccentBrush}"  In code you use (Color)Application.Current.Resources["PhoneAccentColor"]  To determine the Background setting from code you use:  (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility" ] == Visibility.Visible
  • 26. Tips, Trick, & Mango  Hitting the Break key will enable the PC Keyboard in the Emulator.  Mango added some new Advanced Features to the Emulator.  Accelerometer  Location (Map)  Screenshots  There’s a way to enable more than one Emulator.  Long Press of Back button will bring up Application Switching.  Only 30 Apps can register push notifications at one time.
  • 27. Tips, Trick, & Mango – Cont.  You can test Tombstoning by going into the Projects Properties -> Debug tab and checking the box there.  A new menu item under Debug called Windows Phone Performance Analysis.  The WMAppManifest.xml file must contain a request for each Capability it needs access to by adding an entry into the Capabilities element.  Things such as Contacts, Locations, Appointments, etc.  By Default all capabilities are added, remove the items you don’t need.
  • 28. Tips, Trick, & Mango – Cont.  Mango added support for a Front and Back Live Tile.  In general, Tiles flip at regular intervals with each visible tile having a different 'start' time. (...because it looks better than all tiles flipping at the same time.)  Also, Tile flipping is suspended when the phone enters User Idle state, to save battery life, but will restart once the user starts using the phone again.  Live Tiles and Toaster notifications can now Deep Link into the app.  Can go to a specific page using Querystirng parameters.  You can now create multiple Live Tiles per App using this technique.  For Example, Pinning individual People on your Start Page.
  • 29. Tips, Trick, & Mango – Cont.  Mango added better networking support including support for Sockets.  Mango also added support for Background Agents, better Multitasking.  Multitasking for Windows Phone - MSDN  Background Agents Overview for Windows Phone - MSDN
  • 30. Tips, Trick, & Mango – Cont.  Visual Studio has a Market Place Test Kit that allows you to verify your App is Ready for submission.  In VS goto Project -> Open Market Place Test Kit  It helps make sure you have all your App Details setup.  Can run through the same Automated Tests the MS runs on their end.  Can also run through their Manual Test too.  Passing these tests will greatly improve your chance of getting your app approved. You can resolve the majority of the issues and minimize the back and forth overhead.
  • 31. App Submission  100 free app submissions a year.  Failed submissions and updates count towards this number.  $20 to increase the limit.  Paid apps can have a trial version.  No need for a Lite version.  API in code for checking this mode to branch your logic.  Can do beta testing with up to 100 testers.  Private link sent via e-mail.  90 days to test and provide feedback.
  • 32. Wrapping Up  Resources  App Hub  http://create.msdn.com  Windows Phone Development  http://msdn.microsoft.com/en-us/library/ff402535(v=vs.92).aspx  Fundamental Concepts for Windows Phone  http://msdn.microsoft.com/en-us/library/ff967549(v=VS.92).aspx  Mango Jump Start  http://channel9.msdn.com/Series/Mango-Jump-Start  Contact  Jeff.Smoley@w3i.com