You are previewing .NET Compact Framework 3.5 Data-Driven Applications.
O'Reilly logo
.NET Compact Framework 3.5 Data-Driven Applications

Book Description

Build robust and feature-rich mobile data-driven applications with the help of real-world examples

  • Develop data-driven mobile applications from the ground up on top of the Oracle Lite and SQL Server Lite databases

  • Build ergonomic User Interfaces targeting the mobile platform that you can easily adapt for your business applications

  • Optimize performance and security on the mobile platform as well as drawing useful charts and reports using .NET CF's graphics libraries for your data-driven applications

  • Utilize the various tools provided by Microsoft to maintain and fine-tune your enterprise applications with the help of realistic case studies

  • Build three real-world business applications from the ground up with the help of easy-to-understand code snippets to provide practical and hands-on experience

  • In Detail

    The new .NET CF 3.5 framework provides enterprise application developers with a whole arsenal of possibilities at their disposal, but without proper guidance on developing performance-critical enterprise applications, it is easy to make the wrong design and technology decisions.

    This book guides you to build each part of a robust enterprise application by illustrating the .NET CF 3.5 framework with the help of real-world business applications. It will not only help you to master basic .NET CF skills, but also outlines the best methods, techniques, and tools available to create high-impact and performance-critical data-driven enterprise mobile applications. It provides a solid set of guidelines to aid .NET CF developers to understand how best to apply the features of the .NET CF 3.5 framework.

    The bulk of the book illustrates the basic concepts of .NET Compact 3.5 Framework programming by walking the reader through 3 different kinds of mobile applications:

  • A thick-client mobile sales-force application

  • A thin-client mobile dashboard and reporting application

  • A customer support case management application

  • Both the SQL Server Lite and Oracle Lite mobile databases are covered in detail, from data access to data synchronization. The book explains how device features such as Bluetooth, SMS, telephony, Infrared, and Windows Contacts can be accessed via .NET CF in a real-world example, namely the mobile sales-force application. It also explains.NET CF's GDI+ features that can be used to create rich charts and reports. You learn to synchronize the mobile application with remote datasources and communicate via web services and WCF services. The book outlines performance optimization and memory management techniques on the mobile platform. It also outlines the tools and techniques available for testing, performance-tuning, deploying and debugging .NET CF enterprise applications (including Power Toys for .NET Compact Framework 3.5 from Microsoft).

    This book will teach you to build robust, feature-rich enterprise applications using the .NET Compact Framework 3.5, with the help of an end-to-end real-world example of a mobile sales force application.

    Table of Contents

    1. .NET Compact Framework 3.5 Data-Driven Applications
      1. .NET Compact Framework 3.5 Data-Driven Applications
      2. Credits
      3. About the Author
      4. About the Reviewer
      5. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Errata
          2. Piracy
          3. Questions
      6. 1. CRMLive.NET: An Overview
        1. Tomorrow Inc.
          1. The mobile sales force application
          2. The mobile dashboard application
          3. The mobile support case application
          4. Data flow in CRMLive.NET
        2. Deciding on the type of mobile application
          1. Thin clients
          2. Thick clients
          3. Smart clients
          4. Messaging
          5. A brief summary
        3. Defining the mobile sales force application
          1. Capturing lead, opportunity, and customer information
            1. Mobile screen design
            2. Creating reusable controls
            3. Maintaining global lists
            4. Data retrieval and manipulation on the mobile device
            5. Data transfer between multiple mobile devices
          2. Task management
          3. Full-text search functionality
          4. Integrating with Windows Mobile and the hardware
            1. Detect incoming phone calls and SMS
            2. Integrating with the Windows Mobile Calendar and Contacts book
            3. Data exchange using Bluetooth and IrDA
            4. Capturing handwritten input
          5. Data synchronization
          6. Dual database support
          7. Application maintenance and upgrades
        4. Defining the mobile dashboard application
          1. Using stateless web services as a data source
          2. Rendering the dashboard
            1. Road show revenue
            2. Total monthly sales
            3. Sales for last three months
        5. Defining the mobile support case application
          1. Building a messaging backbone with MSMQ
        6. Summary
      7. 2. Building the Data Tier
        1. Designing the data tier
          1. SQL Server CE 3.5 versus Oracle Lite 10g
        2. Connecting the Windows Mobile emulator to ActiveSync
        3. Setting up SQL Server Compact 3.5
          1. Installing SQL Server CE on the development machine
          2. Installing SQL Server CE on the Pocket PC device.
        4. Setting up Oracle Lite 10g
          1. Installing Oracle Lite 10g on the development machine
          2. Installing Oracle Lite 10g on the Pocket PC device
        5. Building the data tier
        6. Building the CRMLiveFramework project
          1. Defining the IDataLibPlugin interface
        7. Building the Plugin Manager UI
          1. An overview
          2. Implementing the PluginCollection class
          3. Implementing the PluginManager class
          4. Creating the SalesForceApp project
          5. Building the ConfigurePlugin form
          6. Building the PluginsSetup form
          7. Testing what you've built so far
        8. Building the database plugins
          1. Implementing the SQL Server CE Plugin
            1. Storing DDL in the resource file
            2. Building the plugin class
            3. Connecting to SQL Server CE
            4. Programmatically creating the SQL Server CE database
            5. Testing what you've done so far
          2. Browsing the SQL Server CE database with Query Analyzer
            1. Retrieving data from SQL Server CE
            2. Data manipulation in SQL Server CE
            3. Dealing with GUID values in SQL Server CE
          3. Implementing the Oracle Lite plugin
            1. Storing DDL in the resource file
            2. Building the plugin class
            3. Connecting to Oracle Lite
            4. Programmatically creating the Oracle Lite database
          4. Browsing the Oracle Lite database with Msql
            1. Retrieving data from Oracle Lite
            2. Data manipulation in Oracle Lite
            3. Dealing with GUID values in Oracle Lite
        9. Summary
      8. 3. Building the Mobile Sales Force Module
        1. A brief walkthrough of what you will be building
        2. Building a form navigation class
        3. Building the main menu
          1. Using Main() as the startup object
        4. Creating the business objects to encapsulate your DataSets
          1. Validating data in your business objects
        5. Building the AccountViewer form
          1. Data binding .NET controls to your business objects
          2. Launching the AccountViewer form
          3. Testing the AccountViewer form
        6. Building the Tasks list
          1. Populating the Tasks Datagrid control
          2. Building the TaskDetailViewer form
          3. Launching the TaskDetailViewer form
          4. Testing the tasks list
        7. Handling file attachments
          1. Building a file manager class
          2. Building the FileUpload user control
          3. Building the FileDetailViewer form
          4. Testing file upload functionality
        8. Custom formatting and display in list controls
          1. Building a collection sorter using the IComparer interface
          2. Custom formatting and display in the list control
          3. Using the History list control
          4. Testing the History list control
        9. Building the ProductList control
          1. Using XML DOM to store and retrieve product selection
          2. Using the ProductList control
          3. Testing the ProductList control
        10. Building a paged listing of accounts
          1. Paging in SQL Server CE
          2. Paging in Oracle Lite
          3. Building a paging user control
          4. Creating a context menu for the paging user control
          5. Launching the accounts listing page
          6. Testing the accounts listing page
        11. Summary
      9. 4. Building Search Functionality
        1. A brief walk-through of parameterized search
        2. Building the parameterized search feature
          1. Creating the parameterized search query in SQL Server CE
          2. Creating the parameterized search query in Oracle Lite
          3. Encapsulating the retrieved Dataset using business objects
          4. Building the parameterized search forms
            1. Building the search form
            2. Building the search results listing form
            3. Trying out your code
        3. A brief walk-through of full-text search
        4. Building the full-text search feature
          1. Creating the Keyword Extractor classes
          2. A sample keyword extractor—the HTML Keyword Extractor
          3. Indexing the file
          4. Creating the full-text search query for SQL Server CE
          5. Creating the full-text search query for Oracle Lite
          6. Encapsulating the retrieved dataset using business objects
          7. Creating the full-text search forms
          8. Trying out the full-text search
          9. Improving the full-text search engine
        5. Summary
      10. 5. Building Integrated Services
        1. Sending SMS and e-mail from your application
          1. Sending SMS and e-mail directly through code
          2. Delegating to the default Windows Mobile Compose UI
        2. Intercepting incoming SMS
          1. Intercepting an SMS message
        3. Placing phone calls from your application
        4. Detecting incoming phone calls
        5. Populating the History tab in the sales force application
          1. Creating the data tier functions to insert historical records
          2. Encapsulating SMS functionality
          3. Encapsulating phone functionality
          4. Intercepting incoming SMS messages and phone calls in the background
          5. Handling outgoing SMS messages and phone calls
          6. Testing your code
        6. Synchronizing with Windows Mobile Contacts
        7. Synchronizing with Windows Mobile Tasks
        8. Sharing an account between two devices
          1. Sharing an account between two devices using Infrared (IrDA)
          2. Sharing an account between two devices using Bluetooth
        9. Capturing handwritten input using the Smart Device Framework
        10. Summary
      11. 6. Data Synchronization
        1. Overview of the different data synchronization methods available for Microsoft SQL Server CE
          1. SQL Remote Data Access (SQLRDA)
          2. Merge replication
          3. Microsoft Synchronization Services
        2. Overview of the different data synchronization methods available for Oracle Lite
          1. Oracle Mobile Server
        3. A quick comparison between the various Synchronization frameworks
        4. Using Microsoft Synchronization Services
          1. Setting up Microsoft SQL Server and Microsoft Synchronization Services
          2. Creating the CRMLive server tables
          3. Creating the WCF service
          4. Configuring the WCF service library
            1. Setting filters for the Sync
          5. Configuring the client project
          6. Writing the sync code
          7. Conflict resolution
        5. Using Oracle Mobile Server
          1. Installing Oracle Database Enterprise 11g and Oracle Mobile Server
          2. Creating an Oracle Mobile repository
          3. Creating the CRMLive server tables
          4. Creating a new publication using the Mobile Database Workbench
            1. Creating a new mobile project
            2. Adding publication items to your project
            3. Adding sequence items to your project
            4. Adding a publication to your project
          5. Publishing the mobile application to the mobile server
          6. Setting up application users using the WebToGo portal
          7. Registering the mobile device with the mobile server
          8. Synchronizing with the mobile server
        6. Synchronizing files with the server
        7. Creating network-aware synchronization modules
        8. Summary
      12. 7. Optimizing for Performance
        1. Measuring performance
          1. Measuring .NET CF code performance
          2. Capturing application performance statistics
        2. Optimizing database performance
          1. Data caching
          2. Using database indexes to boost search performance
          3. Other database optimization tips
        3. Optimizing data transfer performance
        4. Managing better code
          1. Managing better strings
          2. Managing better Winforms
            1. Using BeginUpdate and EndUpdate
            2. Using SuspendLayout and ResumeLayout
            3. Load and cache forms in the background
          3. Managing better XML
            1. Using XMLTextReader and XMLTextWriter
            2. XML serialization and deserialization thesis
          4. Managing better files
        5. The .NET Compact Framework garbage collector
        6. Summary
      13. 8. Securing the Application
        1. Encrypting the database
          1. Encrypting the SQL Server CE database
          2. Encrypting the Oracle Lite database
        2. Authenticating the sales force application
          1. Performing one-way encryption using SHA256
          2. Writing the code for authentication
          3. Loading the login form
        3. Encrypting data for inter-device transmission using AES
        4. Summary
      14. 9. Globalization
        1. Supporting double-byte languages
          1. Supporting Japanese character input in Windows Mobile
          2. Supporting Unicode at the application level
        2. Designing culture-sensitive forms
        3. Retrieving culture information
        4. Summary
      15. 10. Building the Dashboard
        1. An overview of the dashboard
        2. Creating the web service
        3. Creating the dashboard smart client
          1. Connecting to the web service
          2. Creating the line chart
          3. Creating the round gauge
          4. Creating the bar chart
        4. Summary
      16. 11. Building the Support Case System
        1. Introduction to MSMQ and the support case system
        2. Setting up MSMQ on your mobile device
        3. Writing your first MSMQ application
        4. Setting up MSMQ on your server
          1. Creating a queue on the server manually using the computer management panel
        5. Sending a message from the server to a remote mobile device
          1. Sending data to a remote queue
          2. Creating the server-side application
          3. Creating the client-side application
        6. Sending a message from the mobile device to the server
          1. Writing the client-side code
          2. Writing the server-side code
        7. Summary
      17. 12. Testing and Debugging
        1. Overview of Power Toys for .NET CF 3.5
          1. Installing Power Toys for .NET CF 3.5
        2. Using the Remote Performance Monitor and GC Heap Viewer tool
          1. Memory leaks and their causes
          2. A sample application with memory leak
          3. Using the Remote Performance Monitor tool to view application statistics in real time
          4. Using PerfMon to graphically view runtime performance statistics
          5. Using the GC Heap Viewer tool to detect memory leaks
          6. Resolving the memory leak
        3. Using the CLR Profiler tool
          1. A sample application with bad performance
          2. Launching the application with the CLR Profiler tool
          3. Inspecting the Histogram view
          4. Inspecting the Allocation Graph
          5. Inspecting the Time Line view
          6. Inspecting the Call Tree view
        4. Using the App Configuration tool
        5. Using the ServiceModel Metadata tool
        6. Using the Remote Logging Configuration tool
        7. Using the Network Log Viewer tool
        8. Summary
      18. 13. Packaging and Deployment
        1. Deploying your solution as a CAB file
          1. Adding the SalesForce application files to your CAB project
          2. Configuring other miscellaneous settings
        2. Deploying your solution as an MSI file
          1. Creating an INI file
          2. Creating the custom action DLL
          3. Creating the MSI installer project
        3. Creating an automated update service
          1. Creating the server-side web service
          2. Creating the client-side updater tool
        4. Summary