Accelerating Windows Mobile Line of Business Development
Mobile LOB Accelerator Kit In a Nutshell A mobile supply chain + inventory management + route delivery application Based on the.net Compact Framework 2.0 and SQL Server Compact Edition 3.1 (SSCE) Includes the following: Over 5,000 lines of commented code A SQL Server 2005 database Over 100 pages of documentation Microsoft Office Visio architecture diagram Prerequisite installers for.net Compact Framework v2 SP1 and SQL Server Compact Edition to support Windows Mobile 5.0 devices
Mobile LOB Accelerator Kit What s Covered UI Independence Error Logging Application Settings Application layer enforcement Database Access Business Entities Business Services Merge Replication
Mobile LOB Accelerator Kit What s Covered Custom Controls Global Cache Network Availability User Help Notification Balloons MapPoint Web Service CAB Project Splash Screen
Let's take a quick tour Rob Tiffany Senior Technical Product Manager Microsoft Corporation
Application Layer Enforcement Separating the UI, Business, and Data Layer Why separate things when books and marketing demos tell us to put all the code in the form? UI designers don t have to deal with networking, file I/O, or database logic Business object developers don t have to concern themselves with UI elements A mobile app could be moved to the desktop or Web just by changing the UI The database could be swapped with a different data source just by changing the data layer
User Interface Layer Splash Screen Serves as a distraction while the application is loading. With Windows Mobile applications it s often better to perform expensive operations up-front: Create database connections. Load configuration information. Freshen data via replication. Cache global information. Load the main form.
User Interface Layer Adapt your App Today s devices come in all shapes, sizes, resolutions, and orientations that can change on the fly. Child controls can be Docked flush against or even fill a parent control. Child controls can also be Anchored at a distance to one or more sides of a parent control. Forms and panels can automatically create scrollbars when child controls exist outside the viewable area.
User Interface Layer Custom Controls Sometimes the Toolbox doesn t have the right control for the job. The Hardware Distributor needs a control to capture signatures. Visual Studio 2005 supports: Creating a control from scratch where you do all the drawing in the OnPaint event like the signature capture control. Aggregating existing controls into a composite control.
User Interface Layer User Help Reduce your training costs by including Help on each screen of your app. Use a LinkLabel for Stylus operation. Use a MenuItem for One-handed operation. A single HTML file with speciallyformatted keywords is all that s required. Help.ShowHelp(this, @ \HardwareHelp.htm#customerservice");
User Interface Layer Notification Balloons An improvement on the standard MessageBox that slowly pops up from the bottom of the screen. Can render HTML to display messages with rich colors, fonts, tables, hyperlinks, and images. Developers can detect when a hyperlink or HTML button has been clicked.
Business Layer Business Entities Aka Business Objects or Domain Objects. Represents something in the real-world like a Customer that has an Address and City: Customer class, Address property, City property. Constructor to hydrate the Customer class into an object with data contained in the Address and City properties. Relationally speaking, it s a single row with an Address and City column.
Business Layer Custom Collections Aka Domain Model or a set of Domain Objects to group our hydrated Customer objects together. This class inherits from CollectionBase: Wraps an ArrayList with a strongly-typed interface that only accepts Customer objects. Relationally speaking, you have a Customer table with Address and City columns that contain multiple rows of Customer objects. Strongly-typed collections support data binding and outperform DataSets. You can also swap your Collections with Generic Lists.
Business Layer Business Services Executes requests on behalf of the UI and Data layer Verifies Login Credentials Adds Business Entities to Collections Saves Signatures as byte arrays for Database Insertion Tells the Database object to Cache a Connection Loads Application Settings from the Configuration File Tells the Database object to Synchronize with SQL Server Creates Orders Updates Inventory Builds SQL Queries Tells the NetAccess object to test for Network Resource Reachability Tells the FileAccess object to Log Errors Hydrates Business Objects Tells the NetAccess object to Retrieve Maps from MapPoint
Business Layer Global Cache Isn t the use of global variables frowned upon in object-oriented programming? When you have data that you need to maintain throughout the life of your app: Database connection strings. Web Service information. Primitives, objects, and collections that need to be fetched frequently thereby boosting performance. Use the Singleton pattern for your cache class to ensure that only a single instance can exist.
Data Layer Error Logging Help your software developers and testers improve your product by logging errors that are thrown while deployed in the field. When your error handling catches errors or collections of errors, use the StreamWriter to log the following to a text file: Date and Time Error message StackTrace
Data Layer Application Settings How come the Compact Framework doesn t support application configuration files like the desktop? Use the GetAppSetting and SetAppSetting methods found in the Hardware Distributor to read and write to the XML application configuration file. Supports the appname.exe.config format. <?xml version="1.0" encoding="utf-8"?> <configuration> <appsettings> <add key="interneturl" value="http://webserver/ssce/sqlcesa30.dll"/> <add key="internetlogin" value="northamerica\rtiffany"/> <add key="internetpassword" value= P@ssw0rd)"/> <add key="publisher" value= PubServer"/> </appsettings> </configuration>
Data Layer Database Access Mapping objects to a relational database. No, we re not using DataSets, DataAdapters, TableDirect, or even SqlCeResultSets. Includes support for the following: Merge replication. Connection caching. Create Read Update Delete functions. Top queries.
Data Layer Merge Replication Architecture Windows Mobile.NETCFv2 SQL Server Compact Edition Access Point SQL Server Compact Edition Windows Mobile.NETCFv2 IIS/SSCE Server Tools Router Firewall ISA 2006 Cell Tower Mobile Gateway SQL Server Distributor SQL Server Publisher IIS/SSCE Server Tools Windows Mobile.NETCFv2 SQL Server Compact Edition Active Directory
Database Access Code Rob Tiffany Senior Technical Product Manager Microsoft Corporation
Data Layer MapPoint Web Service Sometimes you need to pull over and ask for directions. Via easy to use web services, MapPoint allows you to: Send your start and destination to return a map as a bitmap. Return a route optimized for either speed or distance. Developers can sign up for a free MapPoint development account and download the SDK.
Data Layer Network Availability Knowing Presence before you make the call. Wireless data networks are inherently unreliable and can lead to a bad user experience. The State and Notification Broker will let you know when the network is available. If you want to know if your network resource is reachable, use the WebCheck function in the Hardware Distributor. Cell Tower
Data Layer Merge Replication Microsoft s best out-of-the box solution for synchronizing schemas, indexes, referential integrity, and data between Windows Mobile 6 and SQL Server. Through a Hub and Spoke architecture, it tracks changes in the client and server databases and resolves data conflicts. It securely syncs data over firewall-friendly HTTP(S) and utilizes compression and a binary wire protocol for maximum efficiency.
Sneak Peak at the New Development Tools Codename Orcas v3.5
Resources Windows Mobile Windows Mobile Developer Center http://msdn.microsoft.com/windowsmobile/ Blogs http://blogs.msdn.com/windowsmobile http://blogs.msdn.com/robtiffany Mobile Line of Business Solution Accelerator http://www.microsoft.com/downloads/details.aspx?familyid=80a5c2c5-4f9b-4c1a-bff6-2a3c6b68d15b&displaylang=en Mobile Client Software Factory http://msdn.microsoft.com/library/default.asp?url=/library/enus/dnpag2/html/mcsflp.asp Windows Mobile Developers Wiki http://channel9.msdn.com/wiki/default.aspx/mobiledeveloper.homepage
Resources.NET Compact Framework Team Blog http://blogs.msdn.com/netcfteam/ Compact Framework Forum http://forums.microsoft.com/msdn/showforum.aspx?forumid=33&siteid= 1 Compact Framework on MSDN http://msdn.microsoft.com/netframework/programming/netcf/ Microsoft.NET Compact Framework (Core Reference) Wigley.NET Compact Framework Programming with C# - Yao Compact Framework Newsgroup OpenNETCF http://www.opennetcf.org Mobility, Embedded, and Compact Framework MVP s
2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
Appendix
Deployment CAB Project In the world of Windows Mobile 6, the primary means of software distribution is via the CAB file. Visual Studio 2005 allows you to add a Smart Device CAB project to your mobile solution. It detects dependencies, creates shortcuts and registry entries, and deploys your executable, dlls, database, help, custom controls, and configuration XML file.
Securing Removable Data Stores Storage card encryption Can optionally encrypt data written to storage cards Locally configurable by user Can set policy over the air Avoids problems associated with lost storage cards Cards desktop readable via ActiveSync
State and Notifications Broker State and Notifications Broker provides over 40 new state values Makes total of nearly 150 different state values All provide change notification Broad range of new values Voice Over IP Change in Lock state Device lock, keyboard lock, & SIM lock Communications Largest area of improvement Provides distinct set of events for different communications type GPRS, EVDO, Bluetooth, Wi-Fi, etc. Distinguish between service availability and service connections
Proven Development Platform Windows Mobile Leverage Existing Knowledge Tools The beauty of using the.net Compact Framework to develop 77% the smart client is that we can use the same programming Microsoft model, tools, and Languages skill sets that we used for traditional.net-based application development. Runtimes and APIs Data Sources Oracle Sun Borland 5% 3% 5% IBM 10% Matt Scrafford, Software Development Lead, Xerox 77% of corporate developers already use Microsoft tools for application development Source: Ramp^Rate Dec 2004 Mobile Tool Chain
Objectives And Takeaways Session Objective(s): Describe how the Mobile Line of Business Solution Accelerator Kit empowers developers. Dive into and explore the UI, Business, and Data layers of a Windows Mobile application. Key Takeaways: Be able to recommend the design, development and deployment of mobile line of business solutions to customers looking to mobilize their enterprise.