Getting Started with the Android SDK

The BeyondTrust SDK uses an Android API level of 15 and newer.

  1. To import the BeyondTrust SDK, add libs/bomgarSDK.jar to your project as a library.

The SDK jar contains compiled native libraries for armeabi-v7a, arm64-v8a, mips, x86, and x86_64 architectures. This also includes the jar in a project, which builds its own native libraries. Unless the libraries are manually loaded, the use of other architectures may cause problems.

  1. The SDK also uses the Renderscript Support Library. Projects including the jar need to add the following:

    • "renderscriptSupportModeEnabled true" in build.gradle for gradle builds (Android Studio)

    • "renderscript.support.mode=true" in project.properties for ant builds (Eclipse plugin)

  2. Within the app code, embed your companyid. To obtain this value, navigate to /login > Status > Information and review the Company API Name field, or issue the get_api_info command. Please see API Command: get_api_info.
  3. There are three steps for connecting to the B Series Appliance through the Android SDK.
    1. Create an instance of BomgarSession() using the factory method BomgarSession()Singleton (Application, String, String, int, BomgarSession()Delegate).
    2. Start a session using one of the session start methods found in BomgarSession().
    3. Manage the running session activity using BomgarSession().setRunningActivity (Activity).

Required Permissions

In order for the BeyondTrust SDK to fully function, the host application must be granted certain permissions. Depending on the target api level of your application, the process differs due to the introduction of Runtime Permissions in Android 6.0. See the notes at the end of this section for information relevant to the SDK and runtime permissions.

Regardless of API level, the following permissions must be added to the manifest file in order for the SDK to provide full functionality.

  • android.permission.INTERNET
  • android.permission.ACCESS_NETWORK_STATE
  • android.permission.KILL_BACKGROUND_PROCESSES
  • android.permission.READ_PROFILE
  • android.permission.READ_PHONE_STATE
  • android.permission.READ_CONTACTS
  • android.permission.GET_ACCOUNTS
  • android.permission.WRITE_EXTERNAL_STORAGE
  • android.permission.READ_EXTERNAL_STORAGE

If your application uses system privileged screen scraping, input injection, and process list collection, the following permissions are required.

The APK must be signed with the device firmware's signature to grant these permissions.

  • android.permission.ACCESS_SURFACE_FLINGER
  • android.permission.READ_FRAME_BUFFER
  • android.permission.INJECT EVENTS
  • android.permission.REAL_GET_TASKS
  • android.permission.CLEAR_APP_USER_DATA

To use BeyondTrust InSight, the following permission must be placed in the application manifest along with the uses-feature entry.

The uses-feature entry is a requirement only if the application can be used without the presence of a hardware camera.

  • android.permission.CAMERA
  • <uses-feature android:name="android.hardware.camera.entry.any" android:required="false" />

If your application targets API level 23 or higher, it must account for the new Runtime Permissions. A system prompt appears asking the user to allow each permission group. There are four permission groups that encompass the required permissions. The groups should be requested (and ideally allowed) before the BeyondTrust sessions are started in order for the sessions to collect necessary system information and provide full functionality. The four groups are listed below and can also be inferred from the required permissions list.

  • PHONE
  • CONTACTS
  • STORAGE
  • CAMERA

If Proguard is being used on the application, the following Proguard rules must be used to preserve necessary parts of the SDK from obfuscation.

  • -keep class com.bomgar.android. ** {*; }
  • -dontwarn com.bomgar.android.**

Review Documentation and Sample Project

For more information about the SDK, please see docs > index.html in the SDK bundle.

For a working example of the Android SDK, please reference the Android Paint project provided with the SDK binary.