This article takes you on a quick tour of an enterprise mobile app created with ASNA Mobile RPG. It shows how easy and fast it can be to create a mobile app to run on a smartphone or tablet. Screen shots from both smart phones and tablets are included, but all of the panels displayed are available on both smartphones and tablets. A deep-dive how-to approach isn’t taken here; rather, this article is intended to show how a mobile app with a measure of sophistication can be created with ASNA Mobile RPG.  If you’re not familiar with Mobile RPG, you might want to look at this article in this newsletter first. You can also read more about ASNA Mobile RPG on our Website.

The use case for this application is a hierarchical commercial network (General Manager, Sales Directors, Sales Rep, and Point of Sale) for which business results are shown by level and how Point-of-Sale (POS) orders are handled.

This application’s features include:

Below is a screenshot of the logon screen (Figure 1a) and the CEO menu panel (Figure 1b).

Figure 1a. Login screen

Figure 1b. CEO menu

ASNA Mobile RPG display files are simply extensions to familiar traditional display file idioms. They are composed of record formats, fields and constants and their behavior is (mostly) driven by indicator states just as traditional display files are. Three record formats are used to create the panels in Figures 1a and 1b. One each for the two panels and then a shared error messages format. These three formats are stored in the same mobile display (just as they probably would be in a traditional display file).

With Mobile RPG, after you’ve created a mobile display file (with Mobile RPG’s mobile display file designer), you export that mobile display to a traditional display file. This traditional display file serves as a “proxy” for the mobile display file to the RPG program on the IBM i. At compile time, the RPG program uses this exported display file but at runtime it uses the Mobile RPG mobile display file. The DDS source created by Mobile RPG to export and generate the display file object is shown below in Figure 1c.

Figure 1c. The traditional display file DDS created from the ASNA Mobile RPG display file

By tapping the Total per month option the annual sales chart panel appears (as shown in Figure 2a). The panel in Figure 2a uses Mobile RPG’s chart control. Selecting a month from Figure 2a’s chart displays daily sales data as shown in Figure 2b. This panel uses Mobile RPG’s subfile control to display its tabular data. Selecting a month can be done using the dropdown at the bottom of Figure 2a or tapping the appropriate bar in the chart data of Figure 2a.

Figure 2a. Sales chart

Figure 2b. Sales chart data displayed as a table

Both subfile and graph controls are represented in the exported IBM i display file as traditional subfiles. The resulting DDS generated from this export is shown below in Figures 2c and 2d.

Figure 2c. The subfile generated from the chart shown in Figure 2a.

Figure 2d. The subfile generated from the tabular data shown in Figure 2b.

The underlying RPG program isn’t at all aware that its logic is driving a mobile app. That RPG program reads and writes to the subfiles as defined in Figures 2c and 2d. The RPG that populates these subfiles is shown below in Figure 2e. Note that this RPG is simply regular RPG–there is nothing unique or special about it. With ASNA Mobile RPG,  you simply use the RPG skills you already have to create great mobile apps! At runtime, this subfile data is redirected to the Mobile RPG display file where it is rendered as the chart and the tabular data.

Figure 2e. The RPG that populates Figure 2c and 2d’s subfiles

When the user selects the Total per sales director option (from the panel shown in Figure 1b) a list of sales people is displayed as shown below in Figure 3. Note that for anyone with a phone number a link is provided to initiate a phone call to that person.

Figure 3. The sales director list

Mobile RPG’s integrate well with mobile devices’ intrinsic facilities (eg, text messaging, telephone, GEO location and images).  To initiate a phone call, Mobile RPG provides a special case hyperlink that when tapped invokes the mobile device’s telephone dialer.

Double-clicking on a sales director’s row shows that director’s sales data. Selecting the All item displays a pie chart showing cumulative sales per sales director.

Figure 4a. The sales director sales bar chart

Figure 4b. The sales director accumulative sales pie chart

These screens provide navigation to other levels of the app (eg, navigating from sales director to sales rep, and from sales rep to POS).

The next set of images show the same app running on an iPad tablet. ASNA Mobile RPG supports Apple, Android, and Windows 8-based tablets.

Figure 5a. User login

Figure 5b. POS menu

Accessing the Location option shows the customer’s location using Google Maps.

Figure 6a. POS panel with a Google map

Like its charts and tabular data, Mobile RPG presents the map control to the RPG program as a traditional subfile. The DDS below in Figure 6b is generated when panel shown in Figure 6a is exported to a traditional display file.

Figure 6b. The DDS generated by Mobile RPG to display a Google map.

The RPG to populate the map’s subfile is shown below in Figure 6c.

Figure 6c. The RPG to populate the map’s subfile shown in Figure 6b.

Tapping on the Orders option (shown in Figure 5b) displays the POS orders.

Figure 7a. Open orders panel

Figure 7b. Open order detail

Figure 7c. Changing an order

As you can see, creating mobile applications for the IBM i is now easy and fast with ASNA Mobile RPG and requires no special skills. You only need to know RPG to create great mobile apps with ASNA Mobile RPG.

With ASNA Mobile RPG:

Mobile applications are rapidly moving from luxury to necessity. With Mobile RPG, you can keep your business competitive, adopt powerful new business workflows, and put answers in the hands of your mobile workforce.