SlideShare une entreprise Scribd logo
1  sur  20
Multitasking and
    Local Dababase in
Windows Phone Mango


                        Radu Vunvulea
Windows Phone Mango
    Multitasking
Multitasking
               Fast App Switching
Multitasking and Phone Health
Application Lifecycle
           Reload / refresh
           state only if
           needed




Application is resident in
memory; system detaches        Save state but
resources and pauses threads   do not discard
                               it
Application Lifecycle
           Reload / refresh
           state only if
           needed




Application is resident in
memory; system detaches        Save state but
resources and pauses threads   do not discard
                               it
Background transfer


          20
                      20 MB
          MB




          100     Unlimited
          MB
End-to-End Architecture
Developer          Application                    OS
MyApp Solution           MyApp.dll

 MyApp Project
                          UX                     Single
WMAppManifest            Logic                    App


                 Cloud           ISO Store      System
                                                Services
  MyAppAgent
    Project
                               MyAppAgent.dll
Demo
Background Agents
Ce ne este permis:   Ce nu ne este permis:
• Base API           • Librarii XNA
• Update de tile     • Audio
• Toasts             • Senzori
• Location           • Microfon
• Networking         • Camera
• Storage            • UI
Differences Between Agents

Periodic Agent
•    Runs every 30 minutes     •   Runs on external power
•    Any network connection    •   Non-cell network
•    Runs for 25 seconds           connection

•    Used for location, data   •   Runs for 10 mins, recurring
     sync, etc.                •   Used for daily tasks, large
                                   data syncs, etc.
Windows Phone Mango
   Local Database
Where is database stored


  Application                                Isolated
                                             Storage
                       LINQ to SQL Runtime
     Data Context
  (Sistem.Data.Linq)                            Local
                                              Database
Good to know

• Isolated Storage is used to store database files

• LINQ to SQL is used as the ORM engine

• LINQ is used to query data

• Only System.Data.Linq assembly must be
  added to the project.
Database design

• Custom connection string format:
   Data Source='isostore:/MyDir/DbName.sdf'
  "Data Source='isostore:/MyDir/DbName.sdf'"

• T-SQL queries are not supported

• The code-first approach to defining the
  database schema is preferred in this version
  of Windows Phone 7.1 Mango.
Limitations

• ADO.NET Objects are not supported
• Skip() and Take() require an ordered list and
  constants values
• Only Microsoft SQL CE data types are
  supported
• BinaryFormatter is not supported by default
  (hack: CustomType and implement ToString() and Parse() in your custom
  class)

• ExecuteCommand is not suported – NO T-
  SQL, NO DML statement, NO DDL
Process to follow to use SQL CE




        Implement all database classes:          Create a new database (.sdf) file in Isolated   Populate the database stored in the Isolated
  tables, columns, relations, datacontext, etc   Storage(by default the database is empty)                    Storage with data
Code Sample
Questions
Multumesc

                  Radu Vunvulea
           vunvulear@gmail.com
       vunvulearadu.blogspot.com

Contenu connexe

En vedette

Service Fabric – Microservices in Microsoft World, Radu Vunvulea 30 may 2016 ...
Service Fabric – Microservices in Microsoft World, Radu Vunvulea 30 may 2016 ...Service Fabric – Microservices in Microsoft World, Radu Vunvulea 30 may 2016 ...
Service Fabric – Microservices in Microsoft World, Radu Vunvulea 30 may 2016 ...Radu Vunvulea
 
Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016
Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016
Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016Radu Vunvulea
 
What’s new in azure from an enterprise perspective by Radu Vunvulea
What’s new in azure from an enterprise perspective by Radu VunvuleaWhat’s new in azure from an enterprise perspective by Radu Vunvulea
What’s new in azure from an enterprise perspective by Radu VunvuleaRadu Vunvulea
 
Why you should believe in cloud - ITCluster iQuest Cluj Napoca
Why you should believe in cloud - ITCluster iQuest Cluj Napoca Why you should believe in cloud - ITCluster iQuest Cluj Napoca
Why you should believe in cloud - ITCluster iQuest Cluj Napoca Radu Vunvulea
 
Mobile services on windows azure (part1)
Mobile services on windows azure (part1)Mobile services on windows azure (part1)
Mobile services on windows azure (part1)Radu Vunvulea
 
Real time fluent communication using SignalR and Cloud (Windows Azure)
Real time fluent communication using SignalR and Cloud (Windows Azure)Real time fluent communication using SignalR and Cloud (Windows Azure)
Real time fluent communication using SignalR and Cloud (Windows Azure)Radu Vunvulea
 
First 13 steps to be able to design an application for Azure Service Fabric ...
First 13 steps to be able to design an application for Azure Service Fabric  ...First 13 steps to be able to design an application for Azure Service Fabric  ...
First 13 steps to be able to design an application for Azure Service Fabric ...Radu Vunvulea
 
Mobile services on windows azure (part3)
Mobile services on windows azure (part3)Mobile services on windows azure (part3)
Mobile services on windows azure (part3)Radu Vunvulea
 
Asp.net mvc bad practices
Asp.net mvc   bad practicesAsp.net mvc   bad practices
Asp.net mvc bad practicesRadu Vunvulea
 
Database and Public Endpoints redundancy on Azure (CloudBrew)
Database and Public Endpoints redundancy on Azure (CloudBrew)Database and Public Endpoints redundancy on Azure (CloudBrew)
Database and Public Endpoints redundancy on Azure (CloudBrew)Radu Vunvulea
 
Radu Vunvulea - Microsoft TechDay Baltic 2016 | First 13 steps to be able to ...
Radu Vunvulea - Microsoft TechDay Baltic 2016 | First 13 steps to be able to ...Radu Vunvulea - Microsoft TechDay Baltic 2016 | First 13 steps to be able to ...
Radu Vunvulea - Microsoft TechDay Baltic 2016 | First 13 steps to be able to ...Radu Vunvulea
 
Load tests using Visual Studio 2013 and Azure
Load tests using Visual Studio 2013 and AzureLoad tests using Visual Studio 2013 and Azure
Load tests using Visual Studio 2013 and AzureRadu Vunvulea
 

En vedette (12)

Service Fabric – Microservices in Microsoft World, Radu Vunvulea 30 may 2016 ...
Service Fabric – Microservices in Microsoft World, Radu Vunvulea 30 may 2016 ...Service Fabric – Microservices in Microsoft World, Radu Vunvulea 30 may 2016 ...
Service Fabric – Microservices in Microsoft World, Radu Vunvulea 30 may 2016 ...
 
Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016
Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016
Azure Microservices in Practice, Radu Vunvulea, ITCamp 2016
 
What’s new in azure from an enterprise perspective by Radu Vunvulea
What’s new in azure from an enterprise perspective by Radu VunvuleaWhat’s new in azure from an enterprise perspective by Radu Vunvulea
What’s new in azure from an enterprise perspective by Radu Vunvulea
 
Why you should believe in cloud - ITCluster iQuest Cluj Napoca
Why you should believe in cloud - ITCluster iQuest Cluj Napoca Why you should believe in cloud - ITCluster iQuest Cluj Napoca
Why you should believe in cloud - ITCluster iQuest Cluj Napoca
 
Mobile services on windows azure (part1)
Mobile services on windows azure (part1)Mobile services on windows azure (part1)
Mobile services on windows azure (part1)
 
Real time fluent communication using SignalR and Cloud (Windows Azure)
Real time fluent communication using SignalR and Cloud (Windows Azure)Real time fluent communication using SignalR and Cloud (Windows Azure)
Real time fluent communication using SignalR and Cloud (Windows Azure)
 
First 13 steps to be able to design an application for Azure Service Fabric ...
First 13 steps to be able to design an application for Azure Service Fabric  ...First 13 steps to be able to design an application for Azure Service Fabric  ...
First 13 steps to be able to design an application for Azure Service Fabric ...
 
Mobile services on windows azure (part3)
Mobile services on windows azure (part3)Mobile services on windows azure (part3)
Mobile services on windows azure (part3)
 
Asp.net mvc bad practices
Asp.net mvc   bad practicesAsp.net mvc   bad practices
Asp.net mvc bad practices
 
Database and Public Endpoints redundancy on Azure (CloudBrew)
Database and Public Endpoints redundancy on Azure (CloudBrew)Database and Public Endpoints redundancy on Azure (CloudBrew)
Database and Public Endpoints redundancy on Azure (CloudBrew)
 
Radu Vunvulea - Microsoft TechDay Baltic 2016 | First 13 steps to be able to ...
Radu Vunvulea - Microsoft TechDay Baltic 2016 | First 13 steps to be able to ...Radu Vunvulea - Microsoft TechDay Baltic 2016 | First 13 steps to be able to ...
Radu Vunvulea - Microsoft TechDay Baltic 2016 | First 13 steps to be able to ...
 
Load tests using Visual Studio 2013 and Azure
Load tests using Visual Studio 2013 and AzureLoad tests using Visual Studio 2013 and Azure
Load tests using Visual Studio 2013 and Azure
 

Similaire à Windows Phone: multitasking and local database

Android Architecture
Android ArchitectureAndroid Architecture
Android ArchitectureLope Emano
 
Android Training in Chandigarh
Android Training in ChandigarhAndroid Training in Chandigarh
Android Training in ChandigarhArcadian Learning
 
Android - Application Framework
Android - Application FrameworkAndroid - Application Framework
Android - Application FrameworkYong Heui Cho
 
android vs symbian
android  vs symbianandroid  vs symbian
android vs symbianAJAL A J
 
Application layering vs Application Isolation
Application layering vs Application IsolationApplication layering vs Application Isolation
Application layering vs Application IsolationMarius Sandbu
 
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS SummitDiscover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS SummitAmazon Web Services
 
VMware ThinApp 4.5
VMware ThinApp 4.5VMware ThinApp 4.5
VMware ThinApp 4.5netlogix
 
redpill Mobile Case Study (Salvation Army)
redpill Mobile Case Study (Salvation Army)redpill Mobile Case Study (Salvation Army)
redpill Mobile Case Study (Salvation Army)Peter Presnell
 
ApacheCon BigData - What it takes to process a trillion events a day?
ApacheCon BigData - What it takes to process a trillion events a day?ApacheCon BigData - What it takes to process a trillion events a day?
ApacheCon BigData - What it takes to process a trillion events a day?Jagadish Venkatraman
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudyJohn Adams
 
Nokia Asha App Development - Part 1
Nokia Asha App Development - Part 1Nokia Asha App Development - Part 1
Nokia Asha App Development - Part 1Marlon Luz
 
Game Development for Nokia Asha Devices with Java ME #1
Game Development for Nokia Asha Devices with Java ME #1Game Development for Nokia Asha Devices with Java ME #1
Game Development for Nokia Asha Devices with Java ME #1Marlon Luz
 
Java Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreJava Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreGateway Software Solutions
 
An introduction to Titanium
An introduction to TitaniumAn introduction to Titanium
An introduction to TitaniumGraham Weldon
 

Similaire à Windows Phone: multitasking and local database (20)

Android OS
Android OSAndroid OS
Android OS
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
Android Architecture
Android ArchitectureAndroid Architecture
Android Architecture
 
Android Training in Chandigarh
Android Training in ChandigarhAndroid Training in Chandigarh
Android Training in Chandigarh
 
Android - Application Framework
Android - Application FrameworkAndroid - Application Framework
Android - Application Framework
 
android vs symbian
android  vs symbianandroid  vs symbian
android vs symbian
 
Application layering vs Application Isolation
Application layering vs Application IsolationApplication layering vs Application Isolation
Application layering vs Application Isolation
 
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS SummitDiscover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
Discover MongoDB Atlas and MongoDB Stitch - DEM02-S - Mexico City AWS Summit
 
VMware ThinApp 4.5
VMware ThinApp 4.5VMware ThinApp 4.5
VMware ThinApp 4.5
 
Android OS
Android OSAndroid OS
Android OS
 
redpill Mobile Case Study (Salvation Army)
redpill Mobile Case Study (Salvation Army)redpill Mobile Case Study (Salvation Army)
redpill Mobile Case Study (Salvation Army)
 
ApacheCon BigData - What it takes to process a trillion events a day?
ApacheCon BigData - What it takes to process a trillion events a day?ApacheCon BigData - What it takes to process a trillion events a day?
ApacheCon BigData - What it takes to process a trillion events a day?
 
Foss con2011
Foss con2011Foss con2011
Foss con2011
 
John adams talk cloudy
John adams   talk cloudyJohn adams   talk cloudy
John adams talk cloudy
 
Nokia Asha App Development - Part 1
Nokia Asha App Development - Part 1Nokia Asha App Development - Part 1
Nokia Asha App Development - Part 1
 
Game Development for Nokia Asha Devices with Java ME #1
Game Development for Nokia Asha Devices with Java ME #1Game Development for Nokia Asha Devices with Java ME #1
Game Development for Nokia Asha Devices with Java ME #1
 
Java Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,CoimbatoreJava Training at Gateway Software Solutions,Coimbatore
Java Training at Gateway Software Solutions,Coimbatore
 
An introduction to Titanium
An introduction to TitaniumAn introduction to Titanium
An introduction to Titanium
 
Android Introduction
Android IntroductionAndroid Introduction
Android Introduction
 
20120306 dublin js
20120306 dublin js20120306 dublin js
20120306 dublin js
 

Dernier

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
🐬 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
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 

Dernier (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
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
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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?
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
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...
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

Windows Phone: multitasking and local database

  • 1. Multitasking and Local Dababase in Windows Phone Mango Radu Vunvulea
  • 2. Windows Phone Mango Multitasking
  • 3. Multitasking Fast App Switching
  • 5. Application Lifecycle Reload / refresh state only if needed Application is resident in memory; system detaches Save state but resources and pauses threads do not discard it
  • 6. Application Lifecycle Reload / refresh state only if needed Application is resident in memory; system detaches Save state but resources and pauses threads do not discard it
  • 7. Background transfer 20 20 MB MB 100 Unlimited MB
  • 8. End-to-End Architecture Developer Application OS MyApp Solution MyApp.dll MyApp Project UX Single WMAppManifest Logic App Cloud ISO Store System Services MyAppAgent Project MyAppAgent.dll
  • 10. Background Agents Ce ne este permis: Ce nu ne este permis: • Base API • Librarii XNA • Update de tile • Audio • Toasts • Senzori • Location • Microfon • Networking • Camera • Storage • UI
  • 11. Differences Between Agents Periodic Agent • Runs every 30 minutes • Runs on external power • Any network connection • Non-cell network • Runs for 25 seconds connection • Used for location, data • Runs for 10 mins, recurring sync, etc. • Used for daily tasks, large data syncs, etc.
  • 12. Windows Phone Mango Local Database
  • 13. Where is database stored Application Isolated Storage LINQ to SQL Runtime Data Context (Sistem.Data.Linq) Local Database
  • 14. Good to know • Isolated Storage is used to store database files • LINQ to SQL is used as the ORM engine • LINQ is used to query data • Only System.Data.Linq assembly must be added to the project.
  • 15. Database design • Custom connection string format: Data Source='isostore:/MyDir/DbName.sdf' "Data Source='isostore:/MyDir/DbName.sdf'" • T-SQL queries are not supported • The code-first approach to defining the database schema is preferred in this version of Windows Phone 7.1 Mango.
  • 16. Limitations • ADO.NET Objects are not supported • Skip() and Take() require an ordered list and constants values • Only Microsoft SQL CE data types are supported • BinaryFormatter is not supported by default (hack: CustomType and implement ToString() and Parse() in your custom class) • ExecuteCommand is not suported – NO T- SQL, NO DML statement, NO DDL
  • 17. Process to follow to use SQL CE Implement all database classes: Create a new database (.sdf) file in Isolated Populate the database stored in the Isolated tables, columns, relations, datacontext, etc Storage(by default the database is empty) Storage with data
  • 20. Multumesc Radu Vunvulea vunvulear@gmail.com vunvulearadu.blogspot.com