For Android, the SDK is delivered as a jar file (cirrentsdk.jar) for you to add to your project. Copy the cirrentsdk.jar file to your lib directory, and add it as a build dependency as follows:
Add the command
to your Java application, and you should be ready to go. Javadocs for the SDK are also provided.
Android Sample Application
Along with the Cirrent Android SDK, we will provide you with the source code to a sample application that uses the Cirrent SDK to onboard a device onto the user's private Wi-Fi network, and manage the devices associated with the user's account. The Cirrent Android sample application is written in Java, and provided in source code form to help you while you are modifying your app to incorporate the Cirrent SDK. The Cirrent sample app shows the on-boarding flow for a typical connected product, and also shows how you can use the Cirrent SDK to manage the connected products associated with your user's account.
The main areas of functionality that you should look at are:
- Fragments - these are the screens for the sample app
- LoginFragment - this is the first screen where the user logs in. You should replace this with a login to your cloud.
- AddDeviceFragment - this is the screen where the user searches for nearby unclaimed devices of the correct type that have been powered on recently
- SelectDeviceFragment- this is the screen where the user is shown the list of nearby unclaimed devices. The user selects the one they wish to claim.
- SetupDeviceFragment - this is the screen where the user is shown the options to setting up their device. Their broadband provider may have credentials for this private network, or the user may need to enter the private network credentials manually.
- ConfigureNetworkFragment- this is the screen where the user selects their private network and enters the pre-shared key.
- ConnectingFragment - this is the screen where the user is given status updates as the device joins their private network.
- SuccessFragment - this is the screen that is shown when the device has successfully joined the user's private network. This screen will typically be replaced with the main screen for your connected product.
- ManageDevicesFragment - this is the screen that shows the devices already associated with this user's account
- ManageNetworksFragment - this is the screen where the user can see the private networks already configured in their device.
- AddNetworkFragment - this is the screen where the user can add a new network to a device already associated with their account.
- ConfigurationFragment - this screen lets the user change some configuration settings for the sample app. (This functionality is unlikely to be needed in a production application, as the user will not need to change these settings.)
- SampleCloudService - this is an example of a cloud that will issue tokens to authorize the app to call the Cirrent service. The sample cloud also keeps track of which devices have been bound to the user's account. You should replace the Sample Cloud service with calls to your cloud.