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
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.
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