Packaging and Deploying Samrtphone Applications -part 1
After debugging and testing an application on a real Smartphone device, you may deploy the application on a user’s device. There are three stages in the entire deployment procedure:
- Package the application using a Visual Studio 2005 Smart Device CAB project.
- Deliver the package to a user’s device via a web server, an ActiveSync copy, an e-mail attachment, or a storage card.
- Install the package onto the device.
The following section focuses on the first stage, packaging the application, as this is a core functionality of Smart Device application support in Visual Studio 2005. You will notice the significance of application security in the domain of Smartphone application development. We then briefly introduce several methods for delivering and installing packages.
Packaging Applications
To package a Smartphone application, you must add a Smart Device CAB (cabinet) project to your Visual Studio 2005 solution. From the main menu, select FileAddNew Project. In the Other Project Types category, select Setup and Deployment, and then choose Smart Device CAB Project (not CAB Project) from the Visual Studio installed templates, as shown in Figure 1. A folder with the name of the Smart Device CAB project will be generated under the solution directory. The IDE also presents you with a File System Editor window that shows the filesystem entries you can create on a target device. A CAB file is a type of compressed executable archive file that can contain your application assemblies (EXEs and DLLs), dependencies such as DLLs, resources, help files, and so on, as well as any files related to application security. Most important, an INF (information) file will be generated to describe the destination directory of each installation file on a target device, versions of Windows Mobile for Smartphone on which the application is intended to run, and versions of required .NET Compact Frameworks.
To link the Smart Device CAB project with the FirstSmartphoneApp project, first click Application Folder in the File System Editor window. Then, from the Visual Studio main menu, select ActionAddProject Output, choose the FirstSmartphoneApp project in the Add Project Output Group dialog box, and choose Primary Output from a list of packaging options; thus, only assembly files will be packaged. You can also right-click Application Folder in the File System Editor window to link the Smart Device CAB project with your application project, as shown in Figure 2.
Once you add the application project to the Smart Device CAB project, you may choose to add a registry entry to a target device as part of the application’s installation. In fact, many software products for Windows will create some registry keys for saving configuration settings. To add a registry key for your company named CoolMobile, open the Registry Editor by selecting ViewEditors in the main menu. Then, in the Registry Editor window, browse to HKEY_CURRENT_USER\SOFTWARE\%Manufacturer% and add a new key with a string value of CoolMobile. Now you are ready to build the Smart Device CAB project. This will generate either a Debug folder or a Release folder in the Smart Device CAB project folder, depending on the active configuration of the project. In addition, three files are created in the Smart Device CAB project folder:
- A CAB file (CABProjectName.cab)
- An INF file (CABProjectName.inf)
- A Cab Wizard log file (CabWiz.log) that contains logging information about the packaging process
To be continued…
Popularity: 40% [?]



