Capturing handwritten input using the Smart Device Framework

The Smart Device Framework consists of a set of controls and classes that exposes a broad range of mobile device functionality to the .NET programmer. One of these controls is the Signature control, which allows the end user to perform freehand drawing (using the mobile device stylus). Let's take a look at how you can use this control in your sales force application to capture the customer's signature. When the end user saves the signature, it will be saved as a PNG image file, and will...

Creating an automated update service

Many applications on the mobile device today come with tools that let the user download patches or latest updates from a remote server (when an Internet connection is available) and directly install them on the mobile device. This can help to take the load of maintenance and upkeep of the mobile application off the systems administrator. An automated update service ensures that mobile end users can freely apply patches and updates to their mobile device at the click of a button. Your...

Using the Service Model Metadata tool

If you have created a WCF web service to consume from your mobile application, you can easily connect to it by adding a web reference to it in your mobile application project in Visual Studio (as you've done in Chapter 10, Building the Dashboard). There is, however, another way to do this. The ServiceModel Metadata tool allows you to quickly generate the classes that are required to connect to a WCF web service. You can even specify the language of the generated source code. To test this tool,...

Publishing the mobile application to the mobile server

Your mobile application will not be accessible without first publishing it. Click on the Tool Package menu item to launch the Packaging Wizard. In the first step, choose to create a new application definition. Click Next to advance to the next window. In the next window, choose the target platform for your mobile application. As you are targeting Windows Mobile 6 on the Pocket PC, choose the Oracle Lite PPC60 ARMV4I US option. In the next window, choose a name for your application. This will be...

Using the CLR Profiler tool

The CLR Profiler tool is another powerful tool that allows you to view the memory allocation profile of your application. It provides the details of how your application is allocating and using managed objects. You can look at the heap at various points in time and even walk through the method calls involved in allocating each managed object. While the Remote Performance Monitor tool is useful in detecting memory leaks, the CLR Profiler tool allows you to zoom in on the particular method and...

Deploying your solution as a CAB file

Microsoft Visual Studio provides the necessary project templates to help you build CAB and MSI packages for the smart device. You can create a CAB project by choosing the Smart Device CAB Project template under the Other Project Types Setup and Deployment category in Visual Studio shown as follows Visual Basic Other Languages Other Project Types Setup and Deployment Database Extensibility Visual Studio Solutions Test Projects CAB Project Smart Device CAB Project Sa I esForceAppIn sta 11 erC AB...

Implementing the Plugin Manager class

The PluginManager class will make use of a single instance of the PluginCollection object to hold a list of plugins that are installed on the framework. It will also contain functions that handle the installation of new plugins or the removing of existing ones. More importantly, this class will also need to be able to persist the PluginCollection to disk and to also load it back from disk. This class is expected to use .NET reflection and XML services, so you will need to import the references...

Defining the IData LibPlugin interface

At the heart of the data tier lies the IDataLibPlugin interface. It contains a set of method definitions that define how the sales force application communicates with the SQL Server CE and Oracle Lite databases. An interface is a collection of method definitions without the implementation . A class that implements an interface has to provide implementations for each and every defined method of the interface. Interfaces are great for defining a consistent set of behavior that different classes...

Oracig Database Lite 10g

Mobile Server edzehoo-cc 81 gt Application CRMLIVE Application gt Data Subsetting parameters EDZEHOO Page Refreshed Oct 11, 2009 2 00 14 PM Page Refreshed Oct 11, 2009 2 00 14 PM -X -v In fact, some developers may use different fields to subset their data. C For example, some may decide to use department names to subset their data. The effect is that all user accounts that have the same department name would be able to share each other's data.

Using the Network Log Viewer tool

Once you've used the Remote Logging Configuration tool to enable logging, you can use the Network Log Viewer tool to view the generated logs. You can launch the Network Log Viewer tool from the Start All Programs .NET Compact Framework Power Toys 3.5 menu on your development machine. Navigate to the File Open menu, and browse for the netcf_Network.log file. Once you've opened it, you should be able to see a screen similar to the following screenshot flij .WET Compact Framework Network Log...

Table of Contents

Chapter 1 CRMLive.NET An Overview_9 The mobile sales force application 10 The mobile dashboard application 11 The mobile support case application 12 Deciding on the type of mobile application 13 Defining the mobile sales force application 16 Capturing lead, opportunity, and customer information 17 Data retrieval and manipulation on the mobile device 20 Data transfer between multiple mobile devices 20 Full-text search functionality 21 Integrating with Windows Mobile and the hardware 22 Detect...

Dealing with GUID values in Oracle Lite

In Oracle Lite, the RAW 16 binary data type is typically used to store a GUID value. When you try to retrieve data from a column defined as RAW and apply the to_char function to it, the data retrieved will be returned in the form of a hexadecimal string. The following is an example of such an SQL statement SELECT TO_CHAR AccountGUID FROM Accounts The retrieved data cannot be directly read into a System.Guid object. The hexadecimal string must first be converted into a byte array, and then fed...

Handling outgoing SMS messages and phone calls

When the user sends an SMS message or places a phone call through the sales force application, you would also need to generate a corresponding historical record. There is no equivalent way to 'detect' an outgoing SMS message or phone call using POOM or the SystemState class without resorting to the MAPI functions, so we will look at an easier approach. As you only need to log all outgoing phone calls and SMS messages sent through your application, you can create a general user control to do...

SQL Remote Data Access SQLRDA

SQLRDA was one of the earliest methods of data synchronization between a mobile device and an SQL Server database. It allowed the mobile application to issue push or pull commands to sync data upwards or downwards from the SQL Server database. Through the Client Agent, the mobile application could issue these commands to the Server Agent which sits behind the IIS web server . The Server Agent then executes the requested commands directly on the SQL Server database. It is important to note that...

Building the CRMLive Framework project

This project is meant to be a lightweight Class Library project that, when compiled, produces a .dll file . It contains all the basic, common, and shared classes that will need to be used throughout the Sales Force solution. It is therefore expected to be referenced by all other projects. You will be adding more classes and functionality to the CRMLiveFramework project as you progress through the book. In this chapter though, it will only contain the following items IDataLibPlugin The...

Building the File Upload user control

When you build mobile applications, it is typical to provide file upload functionality in many different screens in your application. So it would make a lot of sense to create a FileUpload user control that is reusable. A user control, unlike an inherited custom control, can be designed using the Visual Studio designer. If you intend to create a control that is a composite of multiple controls, creating it as a user control would be a better alternative than an inherited custom control. The...

Creating the line chart

You're now ready to create your first chart. The first chart is a line chart, which shows the amount of sales for each individual day of the specified month. You can encapsulate the functionality of the line chart in a usercontrol. Add a new usercontrol named LineChart to your project, and set its background color to pure white. This line chart control will need the data you've retrieved from the web service. You can simply pass in the entire lt RoadShowSales gt XML node to this usercontrol,...

Overview of Power Toys for NET CF

In a nutshell, the Power Toys for .NET CF 3.5 package is a set of tools commonly used to gauge application performance and collect diagnostic information for applications developed on .NET CF 3.5. The following table lists down each tool in the package and what it does. Remote Performance Monitor and GC Heap Viewer The Remote Performance Monitor allows you to capture and view performance statistics in real time while your mobile application is running. The GC Heap Viewer allows you to capture...

Creating a new publication using the Mobile Database Workbench

A publication represents an application and its database in the Oracle mobile server. You can create a publication through the Mobile Database Workbench tool provided with Oracle Mobile Server. Launch the Mobile Database Workbench tool from Start All Programs Oracle Database Lite 10g Mobile Database Workbench. Create a new project by clicking on the File New Project menu item in the Mobile Database Workbench window. A project creation wizard will run. Specify a name for your project and a...

SQL Server CE 35 versus Oracle Lite 10g

In a thick client application, an important factor in deciding which mobile database to use depends on what you have installed on the server as your enterprise database. Data synchronization between the device and the enterprise database is usually a job that you want to leave entirely to the database engine. For instance, it doesn't make sense to use Oracle Lite on your mobile device when your enterprise database is SQL Server because they would not be able to sync between themselves. In the...

Creating the business objects to encapsulate your Data Sets

Using raw DataSet objects directly in the presentation layer is not a good practice and should be avoided whenever possible. It makes maintenance a relatively difficult job later on when there are changes to the underlying data tier. Consider the following code snippet. It retrieves a dataset from the data layer and references the data inside using table column names. DataSet _accountsDataset GetAccountsList Datarow _row txtFirstName.text _row FirstName txtLastName.text _row LastName Now, try...

Building the File DetailViewer form

Finally, you need to set up a Datagrid to show a listing of the files for each account. Add a new Files tab to your AccountViewer form. Drop a Datagrid control onto this tab and add another line of code in the SetupBindings method to bind the Datagrid to the BaseAccount.Files property. AccountBindingSource.DataSource typeof BaseAccount AccountBindingSource.Add _account dgFiles.DataBindings.Add new Binding DataSource, AccountBindingSource, Files, true You will now need to build the...

Introduction to MSMQ and the support case system

Msmq Architecture Asp Net

The MSMQ service is a component provided free of charge by Microsoft, and is available to both the PC and mobile device platforms. It is essentially a Windows service you can see it in your list of running services on your development PC. i s ifli bt h m i amp a ie gt Description Provides a messaging infrastructure and development tool for creating distributed messaging applicationsfor Windows-based networks and munr mc Jf 4-U i r r .- wi -. i r_ At the core of MSMQ lies the concept of...

Creating the round gauge

The Smart Device Framework OpenNETCF , as you've encountered earlier in Chapter 5 of this book, provides an out-of-the-box round gauge control that you can readily use in your application. We will now explore how you can make use of this control to display the total monthly sales achieved against the expected sales target. You first used the Smart Device Framework in Chapter 5. If you haven't installed it yet, you can do so now by downloading the Smart Device Framework from the following URL...

Configuring the client project

Now that you've successfully configured the WCF service, you need to configure the smart device client project. In the SalesForceApp project, you can access the WCF service like any normal web service. You can therefore add a reference to the WCF service in the same way through the Add Web Reference menu in Visual Studio . Before you can add the reference, the WCF service must be running in the first place. We can easily do this by first running the WCF service library project in non-debug...

Oracle Mobile Server

The Oracle Lite Mobile Server provides synchronization services between the Oracle Lite database on the mobile device and an Oracle database at the backend server. In fact, the Mobile Server does much more than that. It handles the management of all aspects of mobile application deployment, including user management for each application. The web-based WebToGo portal is used to manage the deployment of your mobile applications. This portal is included in the Oracle Mobile Server installation....

Performing oneway encryption using SHA256

One-way encryption, as opposed to two-way encryption, produces a value that cannot be decrypted in the other direction to produce the original value. It is hence useful for password verification. This is done in the following steps 1. The master account is created a one-way encrypted value for the password is produced and stored in the database. 2. Every time the user wishes to verify the authenticity of his password, the password will be encrypted using the same one-way encryption process, and...

Deploying your solution as an MSI file

This deployment method, unlike a CAB file, is initiated from a PC. An MSI installation still requires an ActiveSync connection to be readily established between the mobile device and the PC, but it does away with the tedious process of having to manually copy the CAB files to your mobile device. The MSI installer also provides the standard wizards that make the deployment of your mobile application feel more like a typical PC application installation. The...

Installing Oracle Database Enterprise 11g and Oracle Mobile Server

The Oracle Mobile Server requires an existing Oracle Database server to function. You can install the latest version of the Oracle Database software on your desktop for testing purposes. Download the latest Oracle Database software for Windows from the following location Install the database software using the default settings and create a database with the SID crmlive. After that is done, you will need to install the Oracle Mobile Server. The Oracle Mobile Server is included in the Oracle Lite...

Using the Remote Performance Monitor and GC Heap Viewer tool

The .NET CF Remote Performance Monitor and GC Heap Viewer tool, as its name suggests, consist of two parts The Remote Performance Monitor, which allows you to view application statistics such as the amount of memory allocated and so on in real time. It is also able to project these statistics to the Windows PerfMon tool so that the data can be viewed as a real-time graph. The GC Heap Viewer tool, which allows you to capture snapshots of the GC heap area the memory area where managed objects are...

Installing SQL Server CE on the Pocket PC device

Now that we have installed SQL Server CE on the development machine, we will try to get a copy of the database engine running on the Pocket PC device. There are a two ways to get Microsoft SQL Server Compact installed on the Pocket PC device MS Visual Studio automated deployment If you have added a reference to SQL Server CE in your project, the SQL Server CE database engine will be automatically deployed to the mobile device when you run or debug your application from inside Microsoft Visual...

Setting up MSMQ on your mobile device

MSMQ is not installed by default on the Windows Mobile platform. This section will guide you on how to install MSMQ on your mobile device or device emulator. You will first need to download the Redistributable Server Components for Windows Mobile 5.0 package which can also be used for Windows Mobile 6.0 from this location 06 2-b8d1-44 0 6ccddb5fd amp displaylang en After downloading and unzipping this file, you will have access to the MSMQ.arm.cab file in the following folder 0ptional Windows...

Creating an Oracle Mobile repository

An Oracle Mobile repository makes use of an existing Oracle database to store the server-side data for your mobile applications. After you install Oracle Mobile Server, you will need to create at least one repository. The Mobile Server Repository Wizard will automatically run after your first installation of Oracle Mobile Server. You can also manually run the Mobile Server Repository wizard from the following location 0LITE10GH0ME Mobile Server admin repwizard.bat In the first screen of the...

Capturing application performance statistics

In the preceding section, you've learned how to measure performance at the code level. However, you can also retrieve performance statistics at the application's working-set level via internal counters maintained by the .NET Compact Framework. This includes, for example, the amount of memory allocated or deallocated during the application's execution. To activate these performance counters, you will first need to enable a key in the registry of your mobile device. Windows Mobile does not come...

Building the Configure Plugin form

The ConfigurePlugin form is a dialog window that lets the user choose a plugin DLL and then subsequently allows him or her to set its data source connection string . It also allows the user to create a new database if one does not exist. Navigate to the Project Add New Item menu item and create a new item based on the Windows Form template. Name this form ConfigurePlugin. The ConfigurePlugin form uses the following controls This is the full path to the . DLL plugin library. The user can...

Populating the Tasks Datagrid control

To populate the Tasks Datagrid control, simply bind the BaseAccount. Tasks property to the Datasource property of the Datagrid. This will feed a TaskCollection object to the grid, which will render every row of data in this collection nicely for you. AccountBindingSource.DataSource typeof BaseAccount AccountBindingSource.Add _account dgTasks.DataBindings.Add new Binding DataSource, AccountBindingSource, Tasks, true Notice that you have not yet specified which columns of the Task object to show...

Using the Remote Logging Configuration tool

If you have developed a mobile application that makes use of remote WCF or web services and you experience problems communicating with the service, you can use Remote Logging to capture all network events that occur between the mobile device emulator and the remote service. The Remote Logging Configuration tool allows you to activate the capturing of network event logs. You can run this tool from the Start All Programs .NET Compact Framework Power Toys 3.5 menu on your development machine. In...

Detecting incoming phone calls

You saw earlier how you could detect incoming SMS messages using the Messageinterception class. How about incoming phone calls You can do the same thing for phone calls but you'll need to use a different class the SystemState class. The SystemState class is a useful class that allows you to query almost every type of state information on the mobile device. It allows you to query information such as battery life, missed phone calls, ActiveSync status, Bluetooth status, calendar events,...

Installing Oracle Lite 10g on the development machine

To install Oracle Mobile server on your development machine, simply follow these instructions 1. Download Oracle Database Lite 10g Release 3 10.3.0.2.0 for Microsoft Windows 32-bit from the following URL index.html. 2. Extract the contents of the downloaded file into any folder on your development machine and run the setup. 3. Install only the Oracle Mobile Development Kit. We will not need to install the Mobile Server at the moment as this will require the installation of the full Oracle...

Preface

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