Mobile SDK - Android
- ARR library: download the password-protected zip package below. The password will be communicated by Cloud4Wi during delivery
- SSID name: note that the SSID is coded in the App, so make sure to know in advance the name of WiFi network you want to enable
- We prepared a getting started project that you can clone and import in your environment to get started. Contact our team to get access to the GIT.
To integrate SDK library into your Android project copy provided AAR file to './app/libs'directory of your App.After that add following dependency to your project's build.gradlealong with 3 required dependencies as described below:
In order to connect your application with Cloud4Wi API you need to provide SDK withclientKey/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 example below:
Alternatively you can call 'setAPIAuthParams' on 'Cloud4WiSDKWiFi' object at Runtime.
In order to access local storage of Android the content provider need to be initialized.
Add the following in 'application' section of your AndroidManifest.xml file:
3. Framework API overview
AndroidManifest of this library requires following permissions:
4. Code examples:
In following code example we will create new customer in the API and then install WPA2-EnterpriseWi-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.
- MobileSDK configuration. Setting API client credentials.
- Read list of organization policies from API.
- Creating new customer in API.
- Verifying customer credentials in API.
- Creation of WPA2-Enterprise Wi-Fi profile on Android device for test user to connect to test SSID.
4. Additional features
Interlinking multiple applications on one device.
Cloud4WiSDKWiFi allows you to share information about installed Wi-Fi profiles among applications on same Android device.This will help to avoid duplications of Wi-Fi profiles and make your application more flexible.
NOTE: this feature is optional, you may need it only if you integrate SDK in more than one application from your domain.
To enable interlinking you have to add the following in 'application' section of your AndroidManifest.xml file:
NOTE: 'multiprocess' and 'exported' parameter values show be set 'true'
After adding required configuration to Android Manifest you have to supply SDK with the list of interlinked applications identifiers: