Custom query task

Description

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

Products: ArcGIS Mobile

Platforms: Windows Mobile 5/6

Requires: Visual Studio 2008 with SP1, .NET Compact Framework 2.0 SP2

How to use

  1. Open the project within 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 you want to query, which column to show, and so forth. 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 choose a value for. 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 (comes with the sample project) to the <ArcGIS Mobile installation path>\bin\Extensions folder on your desktop where you will 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. Tap to open the mobile project.
  9. On the Select Task page, if you don't see the Built-in Query task, scroll down using the arrow keys or rocker.
  10. Tap Built-in 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 for download.


9/20/2011