Native Android Migration Guide
Native Android
Overview
The Inform version (2.0.0 and newer) of the Native Android SDK is designed to improve interoperability with the rest of the Validic ecosystem. It includes improved Record models that closely match the models used in the rest of the Validic Inform system, but offers a clear production upgrade path by maintaining backward-compatibility with the v1 models.
Each module contains a README with usage information for v1 and Inform. You can also find all of the README documentation on this site by starting here and reviewing the appropriate child pages for your use case.
Important Notes
- "Inform SDK" refers to the Validic Mobile SDK release versions that are
2.0.0
and newer. "v1 SDK" refers to all1.x.x
versions of the Validic Mobile SDK. - The Inform SDK is available in a new Artifactory mobile portal. If you are currently using the mobile portal located at https://mobileportal.validic.com/, you will need to be granted access to the new mobile portal. Please contact Validic support to be placed on our waitlist for access to the new mobile portal and Inform SDK.
- The Inform SDK only supports Inform organizations. If you are still using Validic's v1 (legacy API) system, please contact support to migrate to Inform before implementing the new Inform SDK modules/frameworks.
- You must use the Inform version of the Session (
validicmobile-shared
Android module) if you plan to use any other Inform module in your mobile project.- For example, if you are going to update to the Inform
validicmobile-ble
Android module, you must also update to the Informvalidicmobile-shared
Android module at the same time. - The Inform Session supports both v1 and Inform data models for backwards compatibility, so replace the v1 Session with the Inform Session when you start to use modules in your mobile project. You can upgrade the feature SDKs one at a time if you prefer, as long as you have the Inform Session installed.
- For example, if you are going to update to the Inform
Session (validicmobile-shared)
Logging
Validic debug logging has not changed in the Inform SDKs. You can find more details in Logging.
User session
User session behavior remains almost identical to the behavior in v1, with a few notable exceptions:
- There is no "Default user" provided in the Inform SDK. You must use a valid user to initialize the session. If an existing session is loaded with a v1 Default user, the session will fail validation and be ended.
- Submitting records is now done in the
SessionV2
object with a kotlinsuspend
function. - Listening for a session ending event is handled by registering a listener on
SessionV2
. Any unsubmitted Inform records are available as as argument by overridingfun onUserSessionEnded(user: User, records: List<InformRecord>?)
Inform Records
The Record
class and its subclasses have received a big overhaul in the Inform SDK. We've addressed a lot of the weaknesses in the v1 model, as well as brought the models into alignment with what the rest of the Validic Inform system uses. This will make interacting with the native record models much simpler, as they will look almost exactly like the models you receive from the Inform APIs.
The main Validic Record class in the Inform SDK is InformRecord
- all record classes inherit from this class. The subclasses are:
InformMeasurement
: provides point in time measurements, like height, weight, blood pressure, glucose, etc. It replaces v1'sDiabetes
,Biometrics
, andWeight
.InformNutrition
: provides a summary of your daily nutritional intake. It replaces v1'sNutrition
.InformSleep
: provides a record of your sweet, sweet dreams. It replaces v1'sSleep
.InformSummary
: provides a summary of your daily activity, like steps, calories and heart rate. It replaces v1'sRoutine
.InformWorkout
: provides a list of all workout events. It replaces v1'sFitness
.InformIntraday
: provides a list of time series data for a given user. It replaces v1'sIntraday
.
Summary of differences between v1 and Inform records
- In v1 records,
activityID
was used as a unique identifier for each record. That property is calledlogID
in the Inform SDK. - v1 Record subclasses had properties to hold individual measurements, e.g.
Biometrics
had dozens of fields includingsystolic
,diastolic
,temperature
, andspo2
. In the Inform records, each individual measurement is represented as aMetric
, which has its own value, unit, and origin. See the Metrics section below for more info. - The v1 record field
validated
is now represented in each metric's origin. - The data in the v1 field
sourcePeripheral
is now available insource.device.model
. - The data in the v1 field
originalSource
is now available insource.device.manufacturer
. - The data in the v1 field
intermediarySource
is not directly available anywhere, butsource.type
contains something analogous.
Metrics
Each InformRecord
stores a list of Metric
s along that contain its value, its unit, and origin. Value is a BigDecimal
, and unit
is specific to the type and is represented as an enum constant. Note that not all units supported in the Validic Inform system are available in the Inform SDK at this time - we will be working to add more as time goes on.
Origin represents the source of the value, and replaces the v1 record field validated
:
Origin.device
is for metrics that were measured by a device (such as a smart watch, glucometer, etc).Origin.manual
is for metrics that were manually entered by the end user. These might be less trustworthy, as the user could have entered a value incorrectly.Origin.unknown
is for metrics where the origin cannot be reliably determined. This is the default
Here's how to get a metric of a specific type from a record:
val bodyWeightMetric = record.metrics.firstOrNull(it.type == BodyWeight.Type.value);
Bluetooth (validicmobile-ble)
Model changes
The Inform version of the ValidicBluetooth exclusively creates InformRecord
-based records. All callback methods and listeners that previously were called with a v1 Record
subclass will be called with a InformRecord
subclass. See Inform Records for the list of subclasses
Removal of deprecated methods
A new set of callback methods was recently introduced in BluetoothPeripheralControllerListener
that contain return a List<Measurement>
in v2 for the success method.
// v1
public void onSuccess(BluetoothPeripheralController peripheralController, BluetoothPeripheral peripheral, BluetoothDevice bluetoothDevice, List<Record> records);
// Inform
public void onSuccess(BluetoothPeripheralController peripheralController, BluetoothPeripheral peripheral, BluetoothDevice bluetoothDevice, List<Measurement> records);
Out-of-bounds glucose readings
In v1, readings that indicated a high or low glucose value were transformed into +FLT_MAX
and -FLT_MAX
, respectively. In Inform, high and low glucose readings are transformed into +INT_MAX
and -INT_MAX
.
VitalSnap (validicmobile-ocr)
Model changes
The Inform version of the ValidicOCR module exclusively creates InformRecord
-based records. All callback methods and notifications that previously were called with a v1 Record
subclass will be called with a Measurement
. See Inform Records for more information about the Measurement
type.
Units
In v1 when initializing the ValidicOCRController
the enum for each unit type is defined in the Diabetes.Unit.Glucose
enum. For inform these units are enums and constants defined in the validicmobile-ocr
module.
Initializer changes
The OCRViewController
initializer methods take a peripheralID: Int
argument in v1; in Inform, the initializers take a peripheral:OCRPeripheral
argument.
LifeScan (validicmobile-lifescan)
In v1, the helper method is an initializer on Diabetes
; in v2, the helper method is an initializer on Measurement
.
val response = BloodGlucoseResponse() // response from one touch
val measurements = response.asInformMeasurements()
Google Fit
Since Google is sunsetting the Google Fit Android SDKs in June 2025, the Google Fit integration is not offered in the Inform SDK. You will want to use the Health Connect integration instead. Please see the Health Connect migration guide for details on how to migrate your users from the Google Fit integration to the Health Connect integration.
You may run the Google Fit integration in your mobile project at the same time as the Health Connect integration in order to facilitate your users' transition to Health Connect. To do this, install the following modules in your project:
- v1.17.2 or later
aggregator_fit
- v2.0.0 or later
validicmobile-shared
- v2.0.0 or later
aggregator-health-connect
Updated 16 days ago