Installation#

Download#

You have downloaded the ADK zip file from SiliconLabs/gecko_sdk GitHub site.

ADK Structure#

The ADK zip contains:

./app/bluetooth/
    android/                - Android ADK frameworks (debug and release)
    android/dokka/          - Android ADK reference documentation
    android_application/    - Android reference application (source code)
    ios/                    - iOS ADK Frameworks (debug and release)
    ios/docs/               - iOS ADK reference documentation
    ios_application/        - iOS reference application (source code)

Disclaimer: The mobile apps are a reference apps for the Bluetooth Mesh mobile ADK, but it should not be taken as a starting point for customers to create their own mobile apps.

Set Up iOS Project#

  • Copy the BluetoothMesh.xcframework to a folder with the new iOS project (see section ADK Structure for frameworks location).

  • Open the main target in your project.

  • Go to the General view.

  • Add BluetoothMesh.xcframework to Frameworks, Libraries and Embedded Content.

Frameworks, Libraries and Embedded ContentFrameworks, Libraries and Embedded Content

Add FilesAdd Files

BluetoothMesh.xcframeworkBluetoothMesh.xcframework

BluetoothMesh.xcframework should be visible in Frameworks, Libraries and Embedded Content section with “Embed & Sign” chosen.

BluetoothMesh.xcframework visible in FrameworksBluetoothMesh.xcframework visible in Frameworks

Disable Bitcode in the project. BluetoothMesh.xcframework does not use Bitcode.

  1. Select the main target in the project.

  2. Go to the Build Settings view.

  3. Search for Bitcode.

  4. Set Enable Bitcode to No.

Disable BitcodeDisable Bitcode

Set Up Android Project#

  1. Create a project in Android Studio.

  2. Copy the *.aar file to <root path>/app/libs/ from the ADK package.

  3. Add to dependencies {...} section of <root path>/app/build.gradle:

    dependencies {
      ...
      implementation files('libs/ble_mesh-android_api-release.aar')
      implementation 'com.google.code.gson:gson:2.10.1'
    }
  4. Synchronize project after changes.

  5. Initialize a BluetoothMesh object as shown in the following example.

    import com.siliconlab.bluetoothmesh.adk.BluetoothMesh
    import com.siliconlab.bluetoothmesh.adk.configuration.BluetoothMeshConfiguration
    
    class MainActivity : AppCompatActivity() {
        override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContentView(R.layout.activity_main)
    
            BluetoothMesh.initialize(applicationContext, BluetoothMeshConfiguration())
        }
    }
  6. Compile and run the project.