The MemfaultCloud library provides convenience APIs for mobile applications that interact with Memfault's web services.
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
.
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()
}
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.
Use the memfaultCloud.getLatestRelease API to query Memfault's services to find if a new update is available for a device.
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.
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:
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.
com.memfault.cloud.sdk |