QuickStart

Integration

To integrate SDK library into your Android project you need to add Cloud4Wi repository. After that add the following dependency to your project's build.gradle along with 3 dependencies required by Cloud4Wi SDK as described below:

repositories {

    ...
    
    maven {
        url = 'https://artifacts.cloud4wi.com/release'
    }
}

dependencies {

    ...

    implementation 'com.google.android.gms:play-services-ads-identifier:17.0.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.auth0.android:jwtdecode:2.0.0'    
    implementation 'com.cloud4wi:c4w-wifi-sdk:{lib-version}'
}

Configuration

In order to connect your application with your Cloud4Wi account, you need to provide SDK with clientKey and clientSecret credentials.

Credentials may be provided to SDK either via configuration property or at runtime. Add two records into your application's string.xml as in examples below:

Add the following in 'application' section of your AndroidManifest.xml file:

Required permissions

AndroidManifest of this library requires following permissions

Usage Example

In following code example we will create new customer in the API and then install WPA2-Enterprise Wi-Fi profile on Android phone. After that when customer will be in range of Wi-Fi network with specified SSID - his device will connect automatically.

This example represents following use-case.

  1. MobileSDK configuration. Setting API client credentials.

  2. Read list of organization policies from API.

  3. Creating new customer in API.

  4. Verifying customer credentials in API.

  5. Creation of WPA2-Enterprise Wi-Fi profile on Android device for test user to connect to test SSID.

Keep the customer update

To track the last seen date of the customer and to keep always updated the remote push notification token (if applicable) it is necessary to call the method every time the app starts

Last updated

Was this helpful?