Oracle by Example brandingConfiguring a Mobile App in Oracle MAX

section 0Before You Begin

This tutorial shows you how to configure a mobile app by using Oracle Mobile Application Accelerator (Oracle MAX). This tutorial takes approximately 15 minutes to complete.

Background

With Oracle MAX, you can create, test, and publish a cross-platform mobile app without writing a single line of code. After you use Oracle Application Container Cloud to integrate Oracle IoT Cloud Service and Oracle Mobile Cloud Service, the mobile app receives messages from an instance of Oracle IoT Cloud Service.

The following image illustrates the integration of Oracle IoT Cloud Service and Oracle Mobile Cloud Service by using Oracle Application Container Cloud. This tutorial covers the bordered area.

Process to Integrate Oracle Mobile Cloud Service with Oracle IoT Cloud Service
Description of the illustration mcs_intg_1.png

What Do You Need?


section 1Create a Mobile App

  1. Log in to Oracle MAX, click New Application, and enter IOTCS_MCS for the name.
  2. To add your custom API as a data service, click Devices devices icon, and then click Add next to APPLICATION SERVICES.
    The Oracle MAX application interface
    Description of the illustration max_app.png
  3. On the Service Catalog page, select IOTCS_AC_Integration and click Select.
    Service Catalog screen
    Description of the illustration serv_catlg.png
  4. Create four screens to represent the API calls in your custom API. Name the screens Devices, Device Monitor, Device HistoryT, and Device HistoryH.

part 2Design the Screens

  1. On the Devices screen, create six fields named name0, id0, name1, id1, name2, and id2. When you run the app, this screen lists the active devices.
    Layout of the Devices screen
    Description of the illustration device_screen.png
  2. Click the Data tab. To bind the value of the name and ID fields with the name and ID property of the /devices endpoint, select devices for Business Object and enter name for Field Value.
    Bind data to the fields of the Devices screen
    Description of the illustration device_data.png
  3. On the Device Monitor screen, add four fields named id0, Humidity, Temperature, and Location. When you run the app, the ID that you enter in the Devices screen appears in the id field of this screen.
    Layout of the Devices Monitor screen
    Description of the illustration device_monitor.png
  4. To associate the field data with the /devices/{id} endpoint, on the Data tab, select devices for Business Object. On the screen, select the Humidity text area and on the Data tab, enter humidity for Value.
    Bind data to the Humidity field of the Device Monitor screen
    Description of the illustration monitor_data.png
  5. Select the Temperature text area and then, on the Data tab, enter temperature for Value.
  6. Select the Location text area and then, on the Data tab, select Geolocation Code for Location and enter location for Location Value.
    Bind data to the Location field of the Device Monitor screen
    Description of the illustration monitor_location.png
  7. On the Device HistoryH screen, design a line chart and repeat the same on the Device HistoryT screen.

    You view device history in two screens, Device HistoryH and Device HistoryT. The displayed screen depends on the user's selection of humidity or temperature on the Device Monitor screen.

  8. On the Device HistoryT screen, click the Data tab. To bind the chart with the /devices/{id}/history endpoint, select the following values:
    • Business Object: history
    • Values (Y Axis): temperature
    • Categories (X Axis): timeAsString
    Layout of the chart in the DeviceHistoryT screen
    Description of the illustration linechart_temp.png
  9. On the Device HistoryH screen, click the Data tab. To bind the chart with the /devices/{id}/history endpoint, select the following values:
    • Business Object: history
    • Values (Y Axis): humidity
    • Categories (X Axis): timeAsString
    Bind data to the Line Chart of the DeviceHistoryH screen
    Description of the illustration linechart_h.png
  10. To preview your app, click Test test icon. Log in with your test account (created in your Oracle Mobile Cloud service instance) and test the navigation and actions of your mobile app.

Note: To view the complete Oracle MAX app, download and extract package-IoTCS_MCS.zip. Rename your app in Oracle MAX, and then import the downloaded app into Oracle MAX. (You must rename your app because you can’t give the same name to different apps in Oracle MAX.)


more informationWant to Learn More?