Android 10 and MOCA SDK

Android 10 and MOCA SDK

MOCA Android SDK has been tested in the Android 10 OTA. Find the notes for this version below:

  • Android 10 introduces a new permission model where the user can choose between “When in Use” or “Always” location permission. The SDK works correctly with either permission, however geofences and bluetooth beacons won’t be detected in the background if the application has the “When in use” permission. 
  • After upgrading to Android 10, the application permissions will be inherited from the previous version. However, a notification will be presented to the user showing that the application has been using the device location in the background. After tapping on the notification, Android will present options to change this permission to “When in use”. Bear in mind this behavior and clearly present to your users the value of having the “Always” permission enabled.
    • Related Articles

    • Android Permissions Detailed for MOCA SDK

      The MOCA SDK requests a variety of permissions, some of them being optional. Here is a breakdown of each permission and their effect on the SDK:   Permission Explanation android.permission.INTERNET Allows MOCA SDK to open network sockets so it has ...
    • Android Studio Instant Run and MOCA SDK

      It is recommended to turn off Instant Run in Android Studio. Instant Run uses portions of the SDK that might not be necessary for your integration and give you false error and warning messages.   Example stack trace when using Instant Run: I/art: ...
    • MOCA SDK Beacon detection engine latency

      The MOCA SDK detection engine differentiates between foreground and background, and works differently in iOS and Android. For Android, in the foreground it scans more aggressively and, using the Balanced profile, detect beacons within 5 seconds ...
    • Reading MOCA SDK Logs

      The logs related to the MOCA SDK are very helpful to find configuration errors. The log starts with these two lines: I/MOCA: Initializing MOCAPlugin I/MOCA: Init MOCA SDK, version x.x.x This shows that the plugin has started, and which is the version ...
    • My Android app does not detect beacons?

      Beacon detection troubleshooting is divided in three steps: SDK configuration, device configuration and MOCA Console configuration.   1. MOCA SDK requires the following configuration checks in the MOCA.properties file: Flag proximityService is ...