sdk

MemfaultCloud Android

The MemfaultCloud library provides convenience APIs for mobile applications that interact with Memfault's web services.

Sample App

The sample/ directory contains a very basic Android application that demonstrates the functionality of this library. Feedback from user interactions is logged to LogCat and displayed as Toasts.

Before building the app, make sure to update the Project key in SampleViewModel.kt.

Adding the SDK to your project

Add the library to your application's build.gradle:

dependencies {
  implementation 'com.memfault.cloud:cloud-android:2.0.5'
}

The artifact is hosted on the Maven Central Repository, so you may need to add mavenCentral() to your list of project repositories. See the sample app's root build.gradle for an example.

repositories {
   mavenCentral()
   google()
}

Initialization

The MemfaultCloud class is the main entry point for the MemfaultCloud SDK. We recommend creating only one MemfaultCloud instance and using it across your entire application.

Getting the latest release

Use the memfaultCloud.getLatestRelease API to query Memfault's services to find if a new update is available for a device.

Uploading Chunks

The Memfault Firmware SDK packetizes data to be sent to Memfault's cloud into "chunks". See this tutorial for details.

Once you have established sending chunks from your device to the Android app, use the ChunkSender API to upload these chunks to Memfault.

Acknowledgements

We used Square's excellent OKHTTP library as a reference when implementing this SDK's HTTP code.

Copyright (c) 2020, Memfault All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code or in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  2. Neither the name of Memfault nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
  3. This software, with or without modification, must only be used with the Memfault services and integrated with the Memfault server.
  4. Any software provided in binary form under this license must not be reverse engineered, decompiled, modified and/or disassembled.

THIS SOFTWARE IS PROVIDED BY MEMFAULT "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MEMFAULT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Packages

com.memfault.cloud.sdk

Index

All Types