CLI 309 Building Effective Enterprise Mobile Applications Nick
CLI 309 Building Effective Enterprise Mobile Applications Nick Randolph Development Manager Autumn. Care Microsoft MVP -. NET CF
Agenda Session Focus “Enterprise” Mobile Software (EMS) Agenda Enterprise Mobile Architecture Microsoft Mobility Roadmap New Features in Visual Studio 2005 for EMS Development Tool Compact Framework 2. 0 SQL Sever 2005 and it’s mobile version Tips, Tricks and Guidance on Building EMS Prescriptive Guidance Resources
Audience Profile Who has written mobile apps before? Who has written production Microsoft Mobile Application? Who has worked with Compact Framework v 1. 1? Who’s looking at Mobile application development for the first time?
Enterprise Mobile Architecture
What is Mobile Software? What is Mobile? Away from the desk out of the office On the road traveling On the factory floor – always moving Engaging face to face with your customers What is Mobile Software? A device in your hands that helps you with your process E. g. Capturing data, looking up data Doesn’t mean wireless! Concept of offline/online
Why Mobile Software? Why develop mobile software? Information/data at your fingertips Make decisions on the spot Perform your process on the spot What make mobile software “Enterprise” mobile software Access and integration to enterprise information and software assets E. g. Lookup: Customer, Product and Stock information E. g. Capture Data: New Customer Order, Customer Visit information
The Benefits of Mobile Software Reduce paper costs Reduce communication costs Processes automation Increase Productivity Increase Service turn around It is fundamentally about: Saving costs Making more money Capturing data more efficiently Providing data back more efficiently
Usage Examples Couriers Dispatch, Pickup and Sign Territory Managers View products/stock, Place orders Auditors/Insurance Complete audits, print report & quotes Tourists Why can I find information about places in this city?
Some Thoughts on Design Goals for Mobile What problem(s) are you trying to solve? What system(s) are involved? What data do you need from these systems? How will you secure your mobile system? How will you connect your mobile users?
What is Mobile Software? Architectures Real Time vs. Synchronized Telecommunications Devices System Integration
Why is Mobile Software Unique? You can’t always trust the mobile network Devices have limited foot prints Languages and development environments are often proprietary But You still need good software design You still need good software architectures
The Spectrum of Architectures In mobile it’s all about transactions But how do you do these transactions? Real Time Real time over a permanent network Process Data in Real time Otherwise known as “Always Connected” Synchronised Process and store data on the device Synchronise when needed Otherwise know as “Cached”
Real Time Architectures Pros Information is always up to date Data gets processed in the backend faster Cons Poorer user experience on low bandwidth networks. Doesn’t cope well with large amounts of data Working Examples Warehouse Management Systems High Bandwidth / Discrete Transactions
Synchronized Architectures Pros Good for dealing with unreliable networks Data is either synchronised or not Only changes are synchronised User experience is much faster User does not need to be online to process Cons Data can become stale if synchronisation does not often enough Data is pumped into backend system “batch based” Working Examples Sales Force applications Route Management applications Anything with large amounts of reference data
Types of Mobile Applications Smart Clients Run locally on the device Uses local processing power Uses local resources UI rendered on the device Real time / Synchronized applications Key focus for Enterprise Mobile Software Mobile Web Applications Server Side execution – HTML, WAP etc Renders to specific device capability UI rendered on the server Real time applications only
Types of Mobile Application Continued What about writing for multiple devices? Multi-device applications issues • Different form factors • Different device capabilities • Different browser standards Cross platform issues • Different platforms • Different APIs • Different languages Mobile Web Pages Local Code Mobile Web Browser Device Operating System
Mobile Application Devices Low end mobile phones & pagers Smart Devices Full Computer Experience Device separated according to Processor Ability Memory / Storage Capacity User input methods
Mobile Application Devices Low End - Mobile Web Experience Mobile Phones and Pagers Micro browsers WAP, HTML, XML, c. HTML Key based user input Many different devices
Mobile Application Devices Smart Devices Application on Device Stylus Input Online/Offline Capability Local processing power
Mobile Application Devices Full PC Experience Full processing power Full screen display Tablet PC / Laptop
Telecommunications Build your architectures to support TCP/IP And you can use any of these technologies! But test, test! Synchronized architectures work better over slower connections Real time architectures tend to need faster connections for good user experience. Always check for timeouts Applications need to handle “no network” gracefully
System Integration All this data is great but what about? Integrating to / from existing systems? Where does the data go? Where do you need to get data from? Examples Where is your master customer list? Where do your mobile orders get processed?
System Integration Fully integrated vs. Print-outs System Integration can make or break a mobile application Concept of a central mobile database Merge all information required for devices into one place Consolidate all mobile data captured into one place and integrate back in one go Shouldn’t matter whether synchronized or real time architecture
Design Issues User Interface is critical For user adoption Must be simple yet powerful Data resilience is imperative Synchronisation must be seamless It either works or it doesn’t with nothing in between Data partitioning simplifies overheads Deliver data to the users that need it
Design Issues cont. Data partitioning e. g. don’t get every sales person every other sales person’s clients This is horizontal partitioning. Each mobile device has only the data it needs Static (All) vs. Static (Personal) Vertical partitioning is about only pushing the data types on need on a devices Always determine how much data you need and not more.
Scalability To support thousands of users you must consider Network / telecoms usage for all your users Multiple synchronisation points Over the air update frameworks Data storage capacity Keep your audit logs small
Seamless Deployment Seamless Synchronisation One Button Incorporate over–the–air updates Removable Media Card Install e. g. Secure Digital, Compact Flash Lower network costs Enterprise Device Deployment Tool
Data Integrity Data Synchronisation Initialisation Delta based updates A synchronisation is transactional Either works or not! Test power failure scenarios Reinitialise data over the air if required
Microsoft Mobility Roadmap
What do we need? - Concepts Online/Offline Capability Offline – Replicated Data (Main Function) Online – Real time Lookups Security access through firewall tunnel Scalability The ability to scale to 1000 s of users Integrated Approach Consolidate data to/from Backend Systems
What do we need? - Layers User Interface Layer Telecommunications Layer Application / Web Server Data Repository Integration Layer Backend Systems
Physical Architecture
The Template EMS Client Application – online/offline Compact Framework for a rich application SQL Server Mobile + Replication Web Services for Real time SQL Server for Centralised Data store Real time Information Web Services Repository for Mobile Data SQL Server System Integration SQL Server to Backend via Microsoft Biz. Talk Server
Hardware/Drivers OEM/IHV Supplied Programming Model Data Device Building Tools BSP (ARM, SH 4, MIPS) EDB SQL Server 2005 Mobile Edition Relational Native Server Side Standard PC Hardware and Drivers Windows XP DDK Windows Embedded Studio Platform Builder Lightweight Managed OEM Hardware and Standard Drivers SQL Server 2005 Express Edition SQL Server 2005 Win 32 MFC 8. 0, ATL 8. 0. NET Compact Framework ASP. NET Mobile Controls . NET Framework ASP. NET Windows Media Direct. X Multimedia Location Services Map. Point Development Tools Visual Studio 2005 Internet Security and Acceleration Server Exchange Server Live Communications Server Speech Server Communications & Messaging Device Update Agent Management Tools Image Update Software Update Services Systems Management Server Microsoft Operations Manager
New Features in Visual Studio 2005 for Enterprise Mobile Software
Overview Talking about new features Enterprise Focused Everything in Visual Studio 2003 would require another session! Development Tools Visual Studio 2005 Previously Visual Studio 2003 Client Architecture. NET Compact Framework 2. 0 Previous 1. 1 in Visual Studio 2003 Libraries across Display, Layout, Controls, Networking Data Architecture SQL Mobile 2005 Previous SQL CE 2. 0 (VS 2003, SQL 2 K 3)
Visual Studio 2005 for Devices Visual Studio 2005 Enhanced project wizard Target Pocket PC or Smartphone Enhanced designers Emulator support Based on ARM processor Save multiple states
Visual Studio 2005 for Devices Visual Studio 2005 CAB and Setup projects Integrated device and Emulator debugging Remote tools Process viewer, file viewer, Heap walker, and more…
Demonstration Visual Studio 2005 Development Environment Skins New Device Manager Emulators
. NET CF 2. 0 Compatibility and Performance Think of. NET CF 2. 0 of a superset of. NET CF 1. 0 Compatible with full. NET Framework Interoperability – Type must be in. NET CF Protocols – Web Services, Datasets etc Compatible with. NET CF 1. 0 Side-by-side execution Application compatibility Essentially separate frameworks
. NET CF 2. 0 Compatibility and Performance Cont. Enhanced performance Unified JIT for All processors . NET CF 1. 0 2 in. NET CF 1. 0 Improved string handling String Class, String. Builder . NET CF 2. 0 XML improvements XMLText. Reader, XMLText. Writer – Faster than XMLDocument XMLSerialization Improved ADO. NET with SQL Mobile SQLCEResult. Set – Direct Scrollable Cursor
. NET Compact Framework 2. 0 Displays and Layout Orientation support Docking and anchoring Auto. Scroll property – forms, panels Change. Orientation – portrait or landscape Resolution support Automatic scaling Lo to Hi Res Screens Graphics Dpi. X Dpi. Y
. NET Compact Framework 2. 0 New Windows Forms Controls Date. Time. Picker Month. Calendar Document. List Link. Label Notification Help Web. Browser
. NET Compact Framework 2. 0 System. Drawing Namespace Bitmaps Access Bitmap Pixels Bitmap. Lock. Bits(…) Better Image Support Image. Save(…) png, jpg, bmp, tif, gif Bitmap pattern brushes Drawing Images on Containers Direct 3 D support in Visual Studio 2005
. NET Compact Framework 2. 0 System. Xml Namespace Improved performance Schema validation support XSD No DTD or XDR Validation Support Static creation methods for Xml. Text. Reader and Xml. Text. Writer XML searching and processing through XPath Xml. Serialization
. NET Compact Framework 2. 0 System. Messaging Namespace Support for message queuing Send and receive messages Inter-application communication without a live connection Communication using unreliable connections Administer, connect, and monitor network message queues
. NET Compact Framework 2. 0 Language and Runtime Support • Enhanced VB. NET features – "My" namespace support • Enhanced C# features – Iterators – Anonymous methods • Cross language features – Generics – Partial classes
Future Windows Mobile Platform Key Features • Enhanced services and device support – Messaging – SMS, POOM, and telephony – Notifications – signal, battery, connections – Location and Camera APIs • Peripherals support – Microdrvs, cameras, keyboards, second displays • Not part of the core. NET CF 2. 0 – APIs embedded in operating system – Accessed through forthcoming SDK
Notifications Broker Access to Important events that may occur on the device. Centralized publish and subscribe mechanism Store as well as detect the state of a device an application, or a service. Easier access via managed object model.
State and Notifications Broker Development Scenarios Register for notifications You choose the notifications to which you respond Examples Connect to a server when GPRS is available Initiate a synchronization event When fast connectivity is available Synchronize offline store When device is cradled Persist application settings across sessions Respond to low battery notification Schedule device management behavior Create custom notification events
Networking Support Sockets Synchronous and asynchronous Multiple protocols Streams Built on top of sockets HTTP request and response Use stream model Requires no user knowledge of HTTP Applications . NET Compact Framework Web Services HTTP Req/Resp, Network Stream Sockets Common Language Runtime
Data Access – SQL Server Direct SQL Server Access Local SQL Mobile Access ADO. NET Providers included with. NET CF System. Data. Sql. Client System. Data. Sql. Server. Ce
Data Access Direct Database Access Windows Forms ADO. NET SQL Server Data Provider . NET Compact Framework Pros Rich query into a large data source Access to entire data source; device queries for and uses what’s relevant Windows Server Cons Must be constantly connected Not scalable on server; classic “two tier” design No synchronization model for typical dynamic data
System. Data. Sql. Client Useful when data size is too large to be replicated to device memory, but must be accessible Useful for directly connected realtime application as in previous slide SQL Server must always be there
What is SQL Mobile? Next version of “SQL CE” (3. 0) SQL Server “Compact Edition” SQL CE General Design Goals Work on mobile devices Small Footprint (2. 0 had 1. 5 Megs) Extensive SQL Query support Indexing and fast data access Easy of programmability Simple to hook up to a SQL Server Database – Merge Replication
SQL Server / SQL Mobile Replication Windows Forms ADO. NET SQL Mobile. NET Compact Framework SQL Server SQL Mobile Replication (HTTP) Pros Very robust local store Complex SQL querying Synchronized Utilizes HTTP Cons Server configuration required Engine footprint on device
System. Data. Sql. Server. Ce Useful for synchronised scenarios Namespace contains two types of API for two different functions ADO. NET Data Provider for SQL Server CE specific API for replication
SQL Mobile Architecture Improvements in the version 3. 0 Storage engine Multiconnection support Row level locking of data Shares common memory pool Auto-shrink support Improved query processor Cost-based optimization (Query Efficiency!) Show plan and query hints Scrollable, updatable cursor – Sql. Ce. Result. Set
SQL Mobile Synchronization Improvements Improved synchronization control Multiuser synchronization (No app disconnection!) Progress notifications Multiple subscriptions in the same database Synchronization performance (w/SQL 2005) Partitioned groups Download-only tables
SQLCEResult. Set Development Features Included in Visual Studio 2005, so you can use with Intelli. Sense Takes full advantage of SQL Server 2005 Mobile Edition local capabilities Extended Features Scrolling access Update in place, Commit Random access
Synchronization Goals of Synchronization Simplify development of synchronization logic Sync becomes a single line of code Conflict resolution happens on the server through SQL Server model Share a common data source Allow multiuser access to the same data source Improve performance and data concurrency More end-user versatility Allows end users to change devices and still access the data source
Merge Replication Overview Changes reconciled on next synchronization Local SQL Mobile changes sent to SQL Server changes sent to SQL Mobile Edition SQL Server Management Studio wizards Publishers created in studio Subscribers create in studio. NET CF managed wrapper Sql. Ce. Replication
Merge Replication Minimizing the Costs for Device Applications Key to success for device apps is minimizing communication Take only what you need Apply filters Reduce the amount of data sent between devices and server Reduces time Improves responsiveness
Tips, Tricks and Guidance for Enterprise Mobile Software
Tips and Tricks Overview Practices for Real time Applications Practices for Synchronised Applications Pocket Task. Vision User Interface Guidelines Data Architecture Guidelines
Real time Applications Best Practices Useful for applications where Data are very dynamic and caching doesn’t make sense Data on backend is always available Application depends on the network; can’t function without it Detect network connectivity status, and display feedback on status to user where possible – Graceful if fails Use asynchronous network requests and keep UI responsive Handle network errors as gracefully as possible using Try/Catch/Finally
Synchronized Applications Best Practices Useful for applications where Application needs to work without a network User interface “Sync Button or Screen” Provide feedback to the user on the process Especially where connecting over a network Good to show many changes were upload and downloaded
Synchronized / Caching Apps Implementation To retrieve data XML Web services Sql. Client Http. Web. Reqest/Response Sockets Synchronization functionality in SQL Server CE or third-party database To persist data XML files (custom format, or Data. Set) SQL Server CE or third-party database
Application Example from MS Pocket Task. Vision Online/Offline modes Select projects for offline storage Synchronization Conflict Detection SQL Server CE http: //tinyurl. com/5 lbtn
User Interface Guidelines UI Consistency Application Title Standard SIP and New Menu Button/Menu Order Icons and Notification POOM Functionality Wait. Cursor and Input. Panel Designed for Pocket PC Handbook
Data Architecture Guideline Emphasied SQL Mobile to this point but some others for consideration Device Stand alone options In Memory File (plain text, XML, CSV) SQL Mobile (You don’t need SQL Server) Server File – pull down from SQL Server SQL Mobile Other tools for other enterprise sources Synchronisation Replication Webservices Active. Sync
Application Blocks Open. NETCF Configuration Caching Exception Management Smart Client Offline www. opennetcf. org
Summary Enterprise Mobile Architecture Consider and Plan your architecture Spend time getting to know: Visual Studio 2005 Compact Framework SQL Server Mobile Prototype your architectures The tools are all there and ready for you to build enterprise mobile systems
Resources
Resources Mobility Developer Centre: http: //msdn. microsoft. com/mobility/. NET Compact Framework FAQ: http: //msdn. microsoft. com/smartclient/comm unity/cffaq/default. aspx Open. NETCF: http: //www. opennetcf. org/
We invite you to participate in our online evaluation on Comm. Net, accessible Friday only If you choose to complete the evaluation online, there is no need to complete the paper evaluation
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
- Slides: 80