Comet Mobile Usage

From CometWiki

(Difference between revisions)
Jump to: navigation, search
(Gps, Camera, Other Peripherals =)
 
(6 intermediate revisions not shown)
Line 1: Line 1:
= Welcome =
= Welcome =
-
Here we will discuss how to use and program for the Comet Mobile app.
+
Here we will discuss how to use and program for the Comet Mobile app.  For now, please refer to demo programs for examples of specific syntax.  If you cannot find examples of what you are looking for in the demo programs, please contact the [http://support.signature.net support forum] with any questions.
= Using the App =
= Using the App =
Line 20: Line 20:
-
= Programming the App =
+
= Mobile Programs =
Comet Mobile programs must be designed, programmed, and compiled using the Comet Mobile library (mobile.inc).  You cannot run your normal Comet Anywhere programs through the Comet Mobile system.
Comet Mobile programs must be designed, programmed, and compiled using the Comet Mobile library (mobile.inc).  You cannot run your normal Comet Anywhere programs through the Comet Mobile system.
Line 26: Line 26:
First, we will discuss the basic Comet Mobile program structure you should use, then follow up with some programming concepts that can be used to make mobile programs.
First, we will discuss the basic Comet Mobile program structure you should use, then follow up with some programming concepts that can be used to make mobile programs.
-
== Mobile Program Structure ==
+
== Program Structure ==
 +
 
 +
=== Event Handling ===
 +
 
 +
Comet Mobile relies heavily upon the event handling structure built into Comet 32 - in fact, most of the program logic you write will be inside the event handler.  In general, you should preload and present all views and controls at the start of the program.  Then once loaded, let the event handler intercept user actions and show/hide/edit your views and controls in response to user input.
 +
 
 +
You can think of your program as a controller that moderates interactions between the user and your data.
 +
 
 +
=== Initial Set up ===
 +
 
 +
== (Base) View Types ==
 +
 
 +
Your Comet Mobile program must be one of the defined base view types.  Each view type has associated procs and are optimized for certain types of user interactions/data display.  You should be familiar with each view type and utilize them as necessary.
 +
 
 +
=== Basic ===
 +
 
 +
This is the blank canvas view.  It has the most basic functionality, but also gives the most flexibility in the types of user experiences you can provide.
 +
 
 +
=== Table ===
 +
 
 +
A table in this sense is more like a list.  This view allows you to display a list of "cells" that can be selected by the user.  When the user taps a cell, an event is fired with the selected cell key as data.
 +
 
 +
=== Master-Detail ===
 +
 
 +
This is a special type of view controller provided by the iOS platform -- it combines a table view type with a basic view type.  The idea is that when a cell in the table is tapped, a corresponding view should be displayed for that data associated with that cell inside the basic view.  Think of a customer inquiry or maintenance program, with customers displayed in a table, then a display/edit interface that gets modified when the user selects a customer.
 +
 
 +
=== Web ===
 +
 
 +
This is a special view type that allows you to display a web address.  Essentially, it is an extremely basic web browser.
 +
 
 +
=== Pdf ===
 +
 
 +
This view type allows you to display Pdf files on the mobile device.
 +
 
 +
=== Map ===
 +
 
 +
This view type displays a world map where you can drop pins in specific locations.  Locations are based on location strings, which "describe" a location.  It can be anything from GPS coordinates, to (possibly incomplete) street addresses, to landmark names ("Eiffel Tower" and "Central Park" are valid location strings).  Basically anything you can type into a Google Maps search bar and end up with a location pin is valid for the map view.
 +
 
 +
== Sub Programs (Enter/Exit) ==
 +
 
 +
In Comet Mobile, each program has an associated base view type as described above.  In this way, having a single program with multiple view type functionality requires resetting the program with a new base view type, then having a whole second set of event handler methods to deal with that view type's interactions.  Now imagine a third type, or distinguishing two of the same view types for different data.
 +
 
 +
For this reason, we designed Comet Mobile with the idea that individual programs would be small and modular, with a logical and easy pathway between them.
 +
 
 +
Each program should maintain a single view type, and provide functionality and data access associated with that view type.  Then, when the user requires a different type of functionality, '''enter''' a second mobile program that fulfills the requirements.  Once the user is finished, they can '''exit''' back out to the original program.
 +
 
 +
When you enter a second mobile program (using the enter proc), a second view controller is "pushed" on top of the first.  This second program has it's own event handler, base view, and can do anything a normal program or subprogram can do.  Once finished, the subprogram exits back out, and its view controller is "popped" off the stack, and the first mobile program is resumed from right where the enter happened.  Comet Mobile also automatically provides a button in the top left corner of the program view (in the navigation bar) that will fire a specified event in your event handler.  Inside this event, you should save any required data, then exit the program.
 +
 
 +
Using this concept, your mobile programs can remain small and very manageable.  It also provides a user interface experience common among apple mobile apps.
 +
 
 +
== Tables, Sub Tables, and Menus ==
 +
 
 +
For table and master-detail view types, keyed sub tables can play an important role in your mobile program.  As described above, when a table cell is tapped, an event is fired in your program with the cell key specified as data.  If you create another table with a '''tableKey''' that is the same as a cell key, then when that cell is tapped, Comet Mobile will automatically "push" the second table on top of the first.  A button will also appear in the upper left corner of the table (in the navigation bar) that allows the user to "pop" the new table off and go back to the first table.
 +
 
 +
Using multiple tables in a single program, you can create anything from data categories to menu systems.
 +
 
 +
== Pop Out View Controllers ==
 +
 
 +
Some of the view types described above (web, pdf, map) provide "Pop Out" functionality.  Basically, this is a way to launch a simplified version of that view type in a sub window of your program.  So, instead of doing a full-fledged enter of a subprogram to display a pdf file, you could simply "Pop Out" a pdf view with the pdf file specified, and it will load a sub window with the pdf file displayed inside.
 +
 
 +
Pop Out view controllers are very useful for quickly displaying a view that requires minimal interactions.
 +
 
 +
== Gps, Camera, Other Peripherals ==
 +
 
 +
As of now, our mobile peripheral access is limited.  Sorry!

Latest revision as of 22:20, 8 January 2013

Contents

Welcome

Here we will discuss how to use and program for the Comet Mobile app. For now, please refer to demo programs for examples of specific syntax. If you cannot find examples of what you are looking for in the demo programs, please contact the support forum with any questions.

Using the App

In order to use Comet Mobile, you will need to be able to connect (via wireless or cellular network) to a Comet Anywhere Host. The host must be running Comet 32 with the latest version of the REL folder (or at least the MMONITOR program). This program is the interface between your mobile device and the Comet system. In the same fashion as QMONITOR, MMONITOR determines your security access, DAB access, as well as provides a method for you to run your mobile programs.

Connecting

Once you launch the app, the first screen to appear should be the connection screen. Here you can enter a server ip address (or host name), then press the connect button. The app will then connect you to your Comet Anywhere Host and run the MMONITOR program.

Running a Program

Once connected, you will be presented with the MMONITOR run screen. Here you can enter the name of a mobile program you have compiled and loaded onto the host system. These programs must have been compiled for mobile use, using the mobile procs.

Disconnecting

Hit the "Disconnect" button at any time to disconnect your Comet session and return to the connect screen.


Mobile Programs

Comet Mobile programs must be designed, programmed, and compiled using the Comet Mobile library (mobile.inc). You cannot run your normal Comet Anywhere programs through the Comet Mobile system.

First, we will discuss the basic Comet Mobile program structure you should use, then follow up with some programming concepts that can be used to make mobile programs.

Program Structure

Event Handling

Comet Mobile relies heavily upon the event handling structure built into Comet 32 - in fact, most of the program logic you write will be inside the event handler. In general, you should preload and present all views and controls at the start of the program. Then once loaded, let the event handler intercept user actions and show/hide/edit your views and controls in response to user input.

You can think of your program as a controller that moderates interactions between the user and your data.

Initial Set up

(Base) View Types

Your Comet Mobile program must be one of the defined base view types. Each view type has associated procs and are optimized for certain types of user interactions/data display. You should be familiar with each view type and utilize them as necessary.

Basic

This is the blank canvas view. It has the most basic functionality, but also gives the most flexibility in the types of user experiences you can provide.

Table

A table in this sense is more like a list. This view allows you to display a list of "cells" that can be selected by the user. When the user taps a cell, an event is fired with the selected cell key as data.

Master-Detail

This is a special type of view controller provided by the iOS platform -- it combines a table view type with a basic view type. The idea is that when a cell in the table is tapped, a corresponding view should be displayed for that data associated with that cell inside the basic view. Think of a customer inquiry or maintenance program, with customers displayed in a table, then a display/edit interface that gets modified when the user selects a customer.

Web

This is a special view type that allows you to display a web address. Essentially, it is an extremely basic web browser.

Pdf

This view type allows you to display Pdf files on the mobile device.

Map

This view type displays a world map where you can drop pins in specific locations. Locations are based on location strings, which "describe" a location. It can be anything from GPS coordinates, to (possibly incomplete) street addresses, to landmark names ("Eiffel Tower" and "Central Park" are valid location strings). Basically anything you can type into a Google Maps search bar and end up with a location pin is valid for the map view.

Sub Programs (Enter/Exit)

In Comet Mobile, each program has an associated base view type as described above. In this way, having a single program with multiple view type functionality requires resetting the program with a new base view type, then having a whole second set of event handler methods to deal with that view type's interactions. Now imagine a third type, or distinguishing two of the same view types for different data.

For this reason, we designed Comet Mobile with the idea that individual programs would be small and modular, with a logical and easy pathway between them.

Each program should maintain a single view type, and provide functionality and data access associated with that view type. Then, when the user requires a different type of functionality, enter a second mobile program that fulfills the requirements. Once the user is finished, they can exit back out to the original program.

When you enter a second mobile program (using the enter proc), a second view controller is "pushed" on top of the first. This second program has it's own event handler, base view, and can do anything a normal program or subprogram can do. Once finished, the subprogram exits back out, and its view controller is "popped" off the stack, and the first mobile program is resumed from right where the enter happened. Comet Mobile also automatically provides a button in the top left corner of the program view (in the navigation bar) that will fire a specified event in your event handler. Inside this event, you should save any required data, then exit the program.

Using this concept, your mobile programs can remain small and very manageable. It also provides a user interface experience common among apple mobile apps.

Tables, Sub Tables, and Menus

For table and master-detail view types, keyed sub tables can play an important role in your mobile program. As described above, when a table cell is tapped, an event is fired in your program with the cell key specified as data. If you create another table with a tableKey that is the same as a cell key, then when that cell is tapped, Comet Mobile will automatically "push" the second table on top of the first. A button will also appear in the upper left corner of the table (in the navigation bar) that allows the user to "pop" the new table off and go back to the first table.

Using multiple tables in a single program, you can create anything from data categories to menu systems.

Pop Out View Controllers

Some of the view types described above (web, pdf, map) provide "Pop Out" functionality. Basically, this is a way to launch a simplified version of that view type in a sub window of your program. So, instead of doing a full-fledged enter of a subprogram to display a pdf file, you could simply "Pop Out" a pdf view with the pdf file specified, and it will load a sub window with the pdf file displayed inside.

Pop Out view controllers are very useful for quickly displaying a view that requires minimal interactions.

Gps, Camera, Other Peripherals

As of now, our mobile peripheral access is limited. Sorry!

Personal tools