26,26 €
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:
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.
The book walks you through three different real-world mobile applications from head to toe to provide a practical, hands-on experience on how to use .NET CF. It provides you with code snippets (in both VB.NET and C#) from real-world business scenarios. A summary at the end of each chapter explains how these code snippets work together as a part of the larger whole. It also makes use of diagrams to explain core concepts and helps you decide on which design patterns to use in different enterprise application scenarios.
This book is written for developers who are acquainted with the basics of .NET Compact Framework and want to create enterprise-level mobile applications. It is for developers who have worked with the .NET CF Framework before but would like to learn how to utilize its advanced features and deploy leaner and faster business applications.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 417
Veröffentlichungsjahr: 2010
Copyright © 2010 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, Packt Publishing, nor its dealers or distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2010
Production Reference: 1220410
Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK.
ISBN 978-1-849690-10-2
www.packtpub.com
Cover Image by Vinayak Chittar (<[email protected]>)
Author
Edmund Tan
Reviewer
Greg Yap
Acquisition Editor
David Barnes
Development Editor
Rakesh Shejwal
Technical Editors
Neha Damle
Rukhsana Khambatta
Copy Editor
Sanchari Mukherjee
Indexer
Monica Ajmera Mehta
Editorial Team Leader
Gagandeep Singh
Project Team Leader
Lata Basantani
Project Coordinator
Srimoyee Ghoshal
Proofreader
Sandra Hopper
Graphics
Geetanjali Sawant
Production Coordinator
Shantanu Zagade
Cover Work
Shantanu Zagade
Edmund Tan is the CTO and co-founder of a leading e-forms and workflow solution vendor based in Singapore. He holds more than eight years of experience building performance-critical .NET e-forms and workflow solutions for smart devices on top of Oracle and Microsoft SQL Server databases for large companies and governmental institutions located in Singapore and Malaysia. Edmund is also a regular public speaker at various conferences held in Singapore and Malaysia on the topic of on-the-go BPM (Business Process Management) hosted on smart device technologies. During his free time, Edmund works on trying to create machines capable of emulating human thought.
My first and heartfelt word of thanks goes out to David Barnes without whom this book would not have been possible at all. I also thank James Lumsden for giving my e-mail a chance, Rakesh Shejwal and Greg, my long-time collaborator, for their always insightful edits, Srimoyee Ghoshal for keeping me on schedule, Lata Basantani, as well as everyone else involved in this book at Packt.
I extend my gratitude to my parents, Laumee and Obagi, for their undying love and support, my aunt Laumar for instilling the bookworm in me, my wife Shen for keeping the beverages flowing, my kid Sophie simply for being the pride of my life, and, last but not least, my brother Edwin for his jokes during the really, really late hours of the night.
Greg Yap is a tech-savvy person who's always interested in the latest technology. He has worked on .NET since its first release. He has experience in developing software for small, medium, and enterprise-sized companies around the world and has worked on Microsoft technologies for a variety of platforms including the .NET Compact Framework. He is also well versed in the C# and VB.NET programming languages.
I would like to thank my family, especially my understanding wife Jennie who's given me all the support and time I needed to review this great book. To my two kids—thank you! I'm glad that both of you have shown the patience I knew you would. My thanks also go out to my friend Edmund for having considered me as the technical reviewer for this book—I owe you a coffee! Last but not the least, I would like to thank Srimoyee Ghoshal for always being there to keep me on time and the remaining Packt Publishing team for giving me the opportunity to review this book.
As business systems become increasingly distributed, the mobile device becomes an increasingly important tool on the enterprise stage. The large amount of processing power available to mobile devices nowadays bring to it a whole new range of possibilities as a mobile extension to traditional server-based enterprise systems.
Harnessing this power is the .NET Compact Framework, which has seen tremendous improvements over the last few versions. The .NET Compact Framework provides a rich set of managed classes that does away with a big chunk of the menial labor required to perform common tasks, leaving the developer to focus on building business logic instead.
This book is not intended to be a complete reference tome of the .NET Compact Framework. There are numerous books and documentation online that serve this purpose. Rather, it will show you how to apply the .NET Compact Framework in interesting ways to solve real-world business problems. We will explore commonly encountered design decisions and technology comparisons along the way and ultimately build clean solutions that keep to best practices such as the three-tier design and the Model View Controller (MVC) model.
Using a sales force application as the central example and theme in this book, you will have a clear step-by-step guide on building one of the most popular types of business applications in the market today from ground up. Through these pages, you will learn how to create robust data-driven mobile applications that work seamlessly with other mobile devices and database servers. You will get to explore the little nuances of .NET Compact Framework programming, and how to get around them using its advanced features. You will also get a firsthand look at how you can use third-party libraries such as the open source Smart Device Framework to add a host of rich functionality to your applications.
Towards the end of this book, you will have accumulated enough understanding of the capabilities and limitations of the .NET Compact Framework and its tools to confidently tackle an enterprise mobile application of any size or complexity.
I hope in the process of getting there you will have as much fun reading this book and trying out the samples as I had writing it.
Chapter 1, CRMLive.NET: An Overview, provides a technical and scope overview of CRMLive.NET, a mobile customer relationship management suite comprising three individual applications (a mobile sales force, mobile dashboard, and mobile support case application).Chapter 1 also outlines the four different mobile client models and a comparison of their strengths and weaknesses.
Chapter 2, Building the Data Tier, shows how a plugin-based data tier based on both the Microsoft SQL Server Compact and Oracle Lite databases can be created using ADO.NET.
Chapter 3, Building the Mobile Sales Force Module, walks the reader through building the logic and presentation tiers of the mobile sales force application, illustrating various concepts along the way such as UI object reusability, validation, paging, record navigation, sorting, and grouping.
Chapter 4, Building Search Functionality, illustrates how full-text search and parameterized-search functionality can be added to the mobile sales force application.
Chapter 5, Building Integrated Services, illustrates how the sales force application can make use of the .NET Compact Framework and P/Invoke calls to access underlying Windows Mobile operating system and mobile device functionality such as the Bluetooth, Infrared, Calendar, and Telephony services.
Chapter 6, Data Synchronization, covers one of the most important topics in the book—the process of data synchronization between the mobile device and the remote database. In this chapter, we will look at how the sales force application can perform bidirectional synchronization using Microsoft SQL Server Compact's SQL RDA and Oracle Lite's mSync technologies.
Chapter 7, Optimizing for Performance, illustrates how the sales force application's performance can be measured and improved using various techniques such as data caching and data compression.
Chapter 8, Securing the Application, covers the various ways to secure locally stored data on the mobile device. It also covers the various authentication mechanisms available during data synchronization with the remote database.
Chapter 9, Globalization, illustrates how the reader can globalize the sales force application to intrinsically support double-byte (Unicode) languages.
Chapter 10, Building the Dashboard, walks the reader through the building of the second application in CRMLive.NET—the mobile dashboard. It will cover the use of stateless asynchronous web service calls to retrieve XML-based data from a remote server.
Chapter 11, Building the Support Case System, walks the reader through the building of the third application in CRMLive.NET—the mobile support case application. It will cover how a messaging backbone based on Microsoft Messaging Queue (MSMQ) technology can be built to support disconnected-state messaging between two remote applications.
Chapter 12, Testing and Debugging, looks at how the tools provided in the PowerToys for .NET CF 3.5 suite can assist in the testing and debugging process of the CRMLive.NET application.
Chapter 13, Packaging and Deployment, walks through the packaging and deployment process of the CRMLive.NET application and how a network-aware, automated update service can be created to assist in the deployment of application upgrades.
This book provides all source code in both VB.NET and C#. To run most of the code samples in this book, you will need the following basic tools:
Throughout the book, we will also encounter certain technologies and products when we build our application. The following lists the other products used in the book:
This book is primarily targeted at developers who are new to the .NET Compact Framework and wish to embark on data-driven mobile application development in an enterprise scenario. All code samples included in this book are in VB.NET and C#.
This book assumes you are familiar with either the Visual Basic.NET or C# language. It does not require you to have any prerequisite experience or knowledge of the .NET Compact Framework.
This book is also targeted at:
Most of the samples in this book are targeted at the Windows Mobile operating system. Some basic knowledge of the Windows Mobile operating system would be beneficial, but not necessary.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply drop an e-mail to <[email protected]>, and mention the book title in the subject of your message.
If there is a book that you need and would like to see us publish, please send us a note in the SUGGEST A TITLE form on www.packtpub.com or email <[email protected]>.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Downloading the example code for the book
Visit https://www.packtpub.com//sites/default/files/downloads/0102_Code.zip to directly download the example code.
The downloadable files contain instructions on how to use them.
Although we have taken every care to ensure the accuracy of our contents, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in text or code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration, and help us to improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/support, selecting your book, clicking on the let us know link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata added to any list of existing errata. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]> if you are having a problem with any aspect of the book, and we will do our best to address it.
Mobile device programming by itself can be a serious test of software engineering skill, where coders are usually forced to work with a fraction of the resources available compared to the full .NET Framework. Screen area, processor speed, memory, and disk space available stand at a fraction of what one would generally get with a desktop computer. In fact, the .NET Compact Framework implements only thirty percent of the full .NET Framework, doing away with a large subset of the classes deemed to be unsuitable for the small footprint required of a mobile application.
In such a resource-tight environment, the wrong design decisions can often lead to an underperforming application, a clunky interface that irritates users, or worse—grinds to a halt when deployed in an enterprise scenario where hundreds of instances of the application need to exchange and sync data in synchrony.
As you progress through this book, you will find that the three-tier model recurs throughout all chapters. In each approach, you will learn how to think a few steps ahead and adopt designs that allow the various components you are building to fit in together elegantly.
We start this first chapter by exploring an overview of game developer Tomorrow Inc. and CRMLive.NET, a mobile customer relationship management suite that we will be building for this company. By the end of this chapter, you will obtain:
Tomorrow Inc. is a cutting edge gaming company of about 5,000 employees based in New York with branches around the world. They have recently developed a technology that immerses the gamer in a virtual world and are planning to launch their first MMIG (Massively Multiplayer Immersive Game), titled 'Rabbits from Hell' at a road show in New York and Tokyo at the same time.
The products include a virtual reality chair, simply known as 'The Chair,' which is basically an interface to the game that allows full unrestricted physical motion from the player. Used together in conjunction with a set of Virtual Reality goggles, it brings gaming realism to a whole new level by immersing the player completely in the game. The Chair is about the size of an armchair and after purchase, a visit will be typically arranged by Tomorrow Inc. technicians to deliver and install the product in the customer's home.
The road show is the biggest ever launch in the history of Tomorrow Inc., stationing about 100 salespersons at the event itself and another 50 on the streets for a total duration of three weeks. Tomorrow Inc. needs a suite of mobile applications: CRMLive.NET to cater to the needs of three different levels of staff—the salesperson, the boss, and the technician.
Tomorrow Inc. needs a mobile sales force application that will allow its salespersons to capture and manage leads, opportunities, and customers at the event. Before we proceed with the technical requirements, let's explore Tomorrow Inc.'s business a little further in detail.
A 'lead' is a sales term that applies to someone who shows an interest in the product, but how genuine he or she is about buying it has not yet been ascertained. It is usually the intention of the salesperson to convert a lead (a curious prospect) into an 'opportunity' (a serious potential buyer) and eventually into a buying customer.
At any one time during and after the launch of the game, there will be a mix of people from all three categories. There are the curious onlookers at the road show who casually enquire about the game. These people fall under the leads category. Then there are those who have been hounded by salespersons for weeks. They have the money and do show a genuine interest to buy, but need a little more coaxing. These are 'opportunities'. Finally, there are the frenzied young kids who have camped outside the road show hall since 2 a.m., having saved up their entire life savings anticipating the game release. These are undoubtedly buying customers.
Tomorrow Inc. is forecasting a huge flood of visitors to its road show, and has placed a strong emphasis on a lean UI design that can streamline quick data capture and access. The following list highlights the core requirements of this application in brief:
The boss of Tomorrow Inc. travels across country frequently by train; his trips usually take him through areas with little or no Internet connectivity. His requirements are primarily centered on a mobile dashboard application that allows real-time monitoring of sales figures and Key Performance Indices (KPIs). His requirements include:
After the customer purchases a game account, the Tomorrow Inc. technician will need to make a visit to the customer's residence to install and deploy The Chair. Before that can happen, the following series of actions will first take place:
The core requirements for this application include the following:
Based on the requirements outlined in the previous section, we can roughly summarize the data flow of CRMLive.NET in the succeeding diagram. CRMLive.NET comprises three separate and distinct applications that tap into the same central data source.
The sales force application is the key application that provides data to fuel the rest of the system. You will notice from the diagram that mobile devices running the sales force application can also share data directly with each other. This is because salespersons at the event may decide to transfer their leads and opportunities to their colleagues. At the end of the day, all data entered through the sales force application is eventually synced up to the central database.
The support case system will make use of information captured from new customers, such as their residential addresses and phone numbers, to generate new jobs for the technicians.
The mobile dashboard on the other hand will periodically retrieve sales-related data (keyed in when new customers are created) directly from this central database every minute. This sales data is converted into visual charts for display on the mobile dashboard.
Each of these three applications access data in a different way. In all three scenarios, the central database can be accessed over the Internet as well as over an Intranet. We will also explore the different ways to protect data transmission and access throughout CRMLive.NET in the later chapters of this book.
There are four different ways to deploy a mobile application, each with their own benefits and downsides. Before you decide on the type of model to use in your applications, let's take a look at them in further detail.
Applications deployed on a thin client model are accessed through browsers on the mobile device, called mobile browsers or alternatively, mini browsers, or wireless Internet browsers. They are essentially scaled-down versions of a full-blown browser. For instance, the default preinstalled browser that comes with the Windows Mobile operating system, Internet Explorer Mobile, is a mobile browser.
In the thin client model, application code and data are not stored on the mobile device. Just like traditional web-based applications, all the work is done at the server, and each page is served up on-demand as they are accessed from the mobile device. Thin-client applications, therefore do not require the installation of any additional software other than the mobile browser.
Thick clients run entirely on the mobile device and store both code and data locally. It must be installed on the mobile device prior to usage. Thick clients typically utilize a mobile database installed on the same mobile device such as Microsoft SQL Server Compact or Oracle Lite. It is common for thick clients to transfer its data from the local database to a remote and central database periodically so that it can be shared with other units. This process is called data synchronization.
The basic set of features you would find common across thick clients include:
A smart client, sometimes known as a rich client lies somewhere between a thin client and a thick client. Code is still stored locally on the mobile device, but data is stored on a remote server. Data (commonly in the form of XML) is retrieved from or updated to the server in an on-demand fashion whenever needed. There are various ways over which this data exchange can take place, the most common being web service calls, made over the SOAP (Simple Object Access Protocol) interface.
As smart clients still render the UI of the application locally, it has the benefit of a responsive and rich interface. However, smart clients do not have to worry about data synchronization as all data manipulation is done in real time (via web service calls). Smart clients are suitable for projects where:
Lastly, messaging-based mobile applications make use of services such as SMS (Short Messaging Service) and e-mail to drive the interaction between the user and the application. Like the thin client model, it does not require installation of any specific software other than the messaging application itself.
For example, a stock price enquiry service may involve the following actions:
The following table summarizes the various strengths and shortcomings of each type of mobile application:
Feature
Thick client
Thin client
Smart client
Messaging
Requires installation/stores code locally on the mobile device
Y
N
Y
N
Requires live network connection to the application server
N
Y
N
N
Stores data locally and requires database on the mobile device
Y
N
N
N
Allows application to access low level device functions
Y
N
Y
N
Middleware requirements on the mobile device
.NET CF,
Mobile Database
Mobile Browser
.NET CF
Messaging application
UI responsiveness
High
Low
Medium
High
UI richness/interactivity
High
Low
High
Low
Ease of development
Low
Medium
Medium
High
Security
High
Medium
Medium
Low
Ease of application update and maintenance
Low
High
Low
High
Ideal for high transactional volume
Y
N
N
Y
Ideal for data transactions that are large in size (example : file attachments)
Y
N
N
N
Ideal for complex input data (example : forms involving multiple field input)
Y
Y
Y
N
Ideal for complex data input methods (example : digital signatures, barcode scanning)
Y
N
Y
N
Application data latency
Non real-time
Real-time
Real-time
Real-time
Support for different operating systems/devices
Low
High
Low
High
We will first take a look at the mobile sales force application and try to decide on a suitable client model. Looking at the earlier chart, a thick client model would best fit the requirements of this application due to the two key requirements of a responsive UI and offline access support.
You may have also considered the smart client model for this task, but there is no requirement for real-time data transactions in this application. A local database works better in this case because it eliminates network latency that would otherwise be present on the smart client (due to remote database access). Furthermore, a smart client model would not work well in areas without a network connection.
In the following sections, we walk through the main functionality of the application and outline the various .NET Compact Framework technologies that will be used in the process.
Tomorrow Inc. is anticipating a very large turnout at the road show; your users will need 'at a glance' access to key information as well as easy navigation across the various data entry windows.
To cite an example of a screen design that is the product of objective thought, consider the following Lead Details form:
You might be used to the idea that phone numbers, street addresses, and e-mail addresses are related and should all go together under a single Contact Details tab. Thinking objectively though, the salesperson would likely spend more time trying to follow up on a lead making phone calls rather than holding face to face meetings at the lead's address. In this case, it makes for a better design to have the phone number and not the address on the first screen.
When we build this application later on in the book, you will encounter other similar examples and learn how you can minimize the need to switch between tabs by placing the most commonly used fields in a single screen.
We will also extend the idea of objective design to the toolbars and menus in the application, covering best practices and how efficient use of these controls can help reduce on-screen clutter.
You may have also noticed from the previous screenshots that we have placed various icons next to the phone number fields. They allow the user to initiate a phone call or send an SMS directly using the number in the adjacent text box. This control, called the PhoneNumber control (shown in the following screenshot), is one of the various Usercontrols that we will build and reuse throughout this application.
You will also learn how to implement a simple checklist such as the Interested product(s) checklist shown in the succeeding screenshot using the .NET Compact Framework's Listview control.
To make things interesting, we will also feature a dynamic product list that can change any time at the remote server end. We will explore how a sync in the opposite direction (from server to mobile device) can be used to update global lists like this in your application.
As this is the first section dealing with data retrieval and manipulation, we will also get a first-hand look at the ADO.NET libraries and how we can make full use of the library to execute SQL queries against the local database to retrieve and manipulate sales force data.
We will cover data access and ADO.NET in full detail when we build a generic data layer in Chapter 2 ,Building the Data Tier.
Transferring data between one mobile device and another is a common requirement in most enterprise scenarios and our sales force application is no exception. At any point in time, a salesperson may decide to hand over a lead to another colleague, possibly because he or she is not interested in following up on that lead.
Passing the lead to another person means that the receiving party needs to have the lead details and all other relevant data transferred to his mobile device. There are a few different approaches to data transfer, which we will cover in detail when the time comes, but for this application we will concentrate on using both Infrared and Bluetooth technology to transfer a lead record (in compressed XML format) directly from one device to another.
One of the reasons for building a task management module in this application is to allow the salesperson to manage tasks that are lead and opportunity specific. We will choose to implement the task listing using the .NET Compact Framework's DataGrid control due to its rich set of data formatting and data binding capabilities.
You will also learn the basics of using the DataGrid control in this section and how to get around its limitations. We will also cover the following subtopics:
Being able to search within the content of a file and entire databases via an incredibly simple UI comprising a text box and a button is indeed very attractive to any mobile user.
We will build a similar search engine for the sales force application. It will be capable of searching within file content, file names, and database records all at one go.
Microsoft SQL Server Compact and Oracle Lite needs to operate with a small footprint and, unfortunately, does not provide any full-text search feature. We will take it upon ourselves to create a simplified version of the full-text search service of our own. You will learn how to do the following from this exercise:
The following screenshot shows what the search results listing will finally look like in your application:
The mobile device is usually packed with useful hardware and operating system features like telephony, GPS, SMS, and Bluetooth, just to name a few. You can use the libraries in the .NET Compact Framework and the open source Smart Device Framework to access a large range of such functionality from your application.
Looking at an example of how this can work with your sales force application, consider phone number displays in your application. As you saw earlier, you will be creating a reusable PhoneNumber usercontrol that allows users to easily place a phone call or send an SMS message.
You will learn how you can call the Windows Mobile classes in the .NET Compact Framework libraries to achieve this. Most of what follows in this section refers to application features discussed earlier.
We will in fact extend this functionality further using the .NET Compact Framework Message Intercept classes to detect incoming phone calls and SMS. You will see how you can use these events to automatically generate historical log entries for every lead. This allows the salesperson to see a comprehensive history of all correspondence with a particular lead.
If you recall, we had to implement a lead and opportunity-specific task list in this application. What is also unique about this task list is that a copy of the tasks will be automatically pushed to the Windows Mobile Calendar. This allows you to tap into the reminder services in Windows Mobile to remind the user of an impending task. You will learn how to integrate with the Windows Mobile Calendar and Contacts services using the .NET Compact Framework libraries to achieve this functionality.
The benefits are twofold. In addition to not having to reinvent the wheel, this sort of integration opens up a host of functionality behind the scenes. For instance, by placing a copy of the lead- and opportunity-specific tasks in the Windows Mobile Calendar, the user will be able to eventually sync them to Microsoft Outlook on his desktop PC via ActiveSync. This feature is immediately available to your users without having to write any additional line of code!
We will also explore how we can transfer the lead details from one device to another directly using both the device's Bluetooth and IrDA (Infrared) capabilities. You will learn how you can efficiently package and compress XML-based data for transmission across these channels.
When new buyers sign up for a subscription to the game, Tomorrow Inc. needs their signature for record purposes. We can implement signature-capturing functionality using the Smart Device Framework's signature control. The signature will be captured as an image and saved together with the customer record in the database.
In Chapters 3 and 6, we will cover more ground on file attachments and how they can be alternatively stored outside the database in the local filesystem. You will also learn of the different options available to the developer to sync files to a remote server.
Data synchronization for the sales force application is a mix of bidirectional (between mobile device and server) and unidirectional synchronization (mobile device to server only). The synchronization process is closely tied to the database systems that we are deploying for the application. For instance, Oracle Lite uses mSync technology while Microsoft SQL Server Compact uses the Microsoft Sync Framework.
In Chapter 6, Data Synchronization, you will learn how to set up a mobile device and a server for data sync on these two databases. We will also go through the various approaches available to handle data concurrency and integrity during the sync process.
As part of Tomorrow Inc.'s requirements, we will ensure that our sales force application can support both the Oracle Lite 10g and Microsoft SQL Server Compact mobile databases. These two databases differ considerably in terms of their data types, SQL syntax, and synchronization processes.
As we've covered earlier on in this chapter, one of the biggest disadvantages of a thick client is the deployment process. Any subsequent updates to the application need to be redeployed to all devices.
We will mitigate this drawback by building and integrating a network-aware Auto Update service into our sales force application. You will learn how to create a service that can periodically check and download the latest updates from a remote site on its own without the need to cradle the device.
Our second application, the mobile dashboard, will be used by executive-level decision makers in Tomorrow Inc. on the move. The mobile dashboard will need to pull real-time data off the server over an Internet connection, which is then collated and presented on the dashboard in the form of a graphical chart. New data is periodically pulled down from the server every minute to refresh the chart displays.
