Run the Sample Android Enterprise Application

Run the sample Android enterprise application to learn how to use the client software library APIs. The sample enterprise application reads humidity and temperature values of directly connected or gateway devices. The sample enterprise applications can also change device attributes by sending commands through Oracle Fusion Cloud IoT Intelligent Applications. You can run the application on an emulator (Android SDK), or on an Android device running Android KitKat 4.4 or later.

Note:

If you have previously installed and configured Android Studio, you do not need to set the Gradle installation path. If you have an existing emulator, you do not need to create a new one.
  1. Open Android Studio and then select Open an existing Android Studio project.
  2. (Optional) Set the Gradle installation path:
    1. Click Cancel.
    2. Click the Ellipsis (Ellipsis button) button.
    3. Browse to the location of your Gradle installation and then click OK.
  3. (Optional) Create an emulator:
    1. Click Tools, Android, and then AVD Manager.
    2. Click Create Virtual Device to create a new emulator.
    3. Select Phone in the Category list, select a phone model, and then click Next.
    4. Select a system image, click Next, and then click Finish.
  4. Browse to C:\users\user-name\documents\iotcs\csl\android\samples, select EnterpriseSampleApplication, and click then click OK.
  5. Open a command prompt and browse to C:\Users\user-name\AppData\Local\Android\sdk\platform-tools.
  6. Run this command to copy the device provisioning file to the emulator SD card:
    adb.exe push C:\Users\user-name\Documents\iotcs\csl\android\bin\IntegrationID-provisioning-file-apps.conf\sdcard\
  7. Provision the application:
    1. Click the Run (Run icon) on the Android Studio toolbar and then select an emulator in the list.
    2. Click ALLOW, click SELECT, enter the provisioning file password, and then click PROVISION APPLICATION.
    3. Select Humidity Sensor and Temperature Sensor and then click NEXT.
    4. Select a device and then click NEXT.
  8. Confirm data is being sent from the application to Oracle Fusion Cloud IoT Intelligent Applications:
    1. Open the Oracle Fusion Cloud IoT Intelligent Applications management console.
    2. Click the Menu (Menu icon) icon.
    3. Click Devices and then Alerts and Messages.
      Use the Device_ID Temperature Sensor page to:
      • View the start time for the device.

      • Monitor the current temperature, the minimum and maximum recorded temperatures, and the minimum and maximum thresholds for the device.

      • Control the device. Use the seek bar to change the minimum and maximum temperature thresholds, the RESET button to reset temperature, the ON, OFF slide button to switch the device on or off, the BACK button to return to the Select Device to Monitor page.

      • Compare the monitoring information with the information displayed in Oracle Fusion Cloud IoT Intelligent Applications.