Application flow

In this section we will examine the application flow to better understand the relation among the application's functionality, the UI, and the classes used to deliver this functionality. Doing this process up front helps ensure that the application delivers the needed functionality and assists in defining which classes we require when it comes time to start coding, which is soon! Figure 12.3 shows the relation between the high-level

classes in the application, which are implemented as an Android Activity as well as interaction with other services available in Android.

Here is the procession of steps in the application:

1 The application is selected from the application launch screen on the Android device.

2 The application splash screen displays. Why? Some applications require setup time to get data structures initialized. As a practical matter, such time-consuming behavior is discouraged on a mobile device; however, it is an important aspect to application design, so it is included in this sample application.

3 The main screen displays the currently configured user and server settings, along with three easy-to-hit-with-your-finger buttons.

4 The Refresh Jobs button initiates a download procedure to fetch the currently available jobs for this mobile worker from the configured server. The download includes a ProgressDialog, which is discussed later in this chapter.

5 The Settings button brings up a screen that allows the configuration of the user and server settings.

6 Selecting Manage Jobs lets our mobile worker review the available jobs assigned to him and proceed with further steps specific to a chosen job.

7 Selecting a job from the list of jobs on the Manage Jobs screen brings up the Show Job Details screen with the specific job information listed. This screen lists the available information about the job and presents three additional buttons.

8 The Map Job Location button initiates a geo query on the device using an Intent. The default handler for this Intent is the Maps application.

9 Because our mobile worker may not know much about the product he is being asked to service, each job includes a product information URL. Clicking this button brings up the built-in browser and takes the mobile worker to a (hopefully) helpful internet resource. This may be an online manual or an instructional video.

10 The behavior of the third button depends on the current status of the job. If the job is still marked OPEN, this button is used to initiate the closeout or completion of this job.

When the close procedure is selected, the application presents an empty canvas upon which the customer can take the stylus (assuming a touch screen-capable Android device, of course!) and sign that the work is complete. A menu on that screen presents two options: Sign & Close or Cancel. If the Sign & Close option is selected, the application submits the signature as a JPEG image to the server, and the server marks the job as CLOSED. In addition, the local copy of the job is marked as CLOSED. The Cancel button causes the Show Job Details screen to be restored.

11 If the job being viewed has already been closed, the browser window is opened to a page displaying the previously captured signature.

Now that we have a pretty good feel for what our requirements are and how we are going to tackle the problem from a functionality and application-flow perspective, let's examine the code that delivers this functionality.

0 0

Post a comment