Run the Sample Android Directly Connected Device Application

Run the sample Android directly connected device application to learn how to use the client software library APIs. The sample directly connected device applications use software to simulate temperature and humidity sensors. The sample directly connected device applications periodically send temperature and humidity data to 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. Open a command prompt and browse to C:\Users\user-name\AppData\Local\Android\sdk\platform-tools.
  5. 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\provisioning-file.conf /sdcard/
  6. Provision the application:
    1. Click the Run (Run icon) 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.
      To run the application with device policies, select the Use Device Policy check box that appears on the emulator screen.
    3. Review the messages displayed on the emulator screen.
  7. 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.
    4. Confirm temperature and humidity data is being sent to Oracle Fusion Cloud IoT Intelligent Applications.