Custom query task

Description

This sample shows how to create a task with the application framework, letting you perform a query based on criteria from both stored and user inputs. Part of the query criteria is stored in the application files and will be loaded by the application, while other criteria can be specified through custom pages. From this sample, you'll learn how to store additional information with the Windows Mobile application and how to read and write to it.

Prerequisites

Product: ArcGIS for Windows Mobile

Platforms: Windows Mobile 5/6

Requirements: Visual Studio 2008 with SP1, .NET Compact Framework 3.5

How to use

  1. Open the project in Visual Studio 2008. Learn how to set up your development machine.
  2. Compile the project and deploy the assembly to your mobile device or emulator. Read more information about deployment.
  3. Open the BuiltInQueryTask_ProjectCenter project and find the WriteXML method on the user control source code. The WriteXML method writes parameters to your mobile project package. You can specify which layer to query, which column to show, and so on. StaticParameter acts like a hard-coded query criterion. You can specify a field name and a field value. DynamicParameter refers to the search criterion you want to value. The prompt string is displayed on the search page to replace the original field name, and the value is the default value. Change DynamicParameter to meet your needs and match your data.
  4. Build and deploy the Mobile Project assembly file (available with the sample project) to the <ArcGIS Mobile installation path>\bin\Extensions folder on your desktop where you'll author your mobile project with the Mobile Project Center application.
  5. In Mobile Project Center, add Custom Query Task to your project on the Tasks tab.
  6. Deploy your mobile project to your Windows Mobile device or emulator. Get more details on deployment.
  7. Start the out-of-the-box mobile application.
  8. Open the mobile project.
  9. On the Select Task page, if you don't see the Custom Query task, scroll down using the arrow keys or rocker.
  10. Tap Custom Query and navigate to a new page.
  11. Provide the dynamic query parameter on the page shown and perform the query.

Where to get the sample

The sample is available to download from ArcGIS Online.

1/7/2015