This library automatically persist on reboot/poweroff the system wall clock time, using the DS3231 driver, without the need of any code change.
NOTE: these drivers are not production-ready. They are offered as sample implementations of Android Things user space drivers for common peripherals as part of the Developer Preview release. There is no guarantee of correctness, completeness or robustness.
This driver is based on the jpuderer-things-drivers driver from jpuderer
If you are just interested in persisting the system wall clock time when you reboot or
power off your device, simply add the line below to your project's build.gradle
,
where <version>
matches the last version of the driver available on jcenter.
No additional code changes are required.
dependencies {
implementation 'com.leinardi.android.things:driver-ds3231-receiver:<version>'
}
The I2C port name is automatically detected for any officially supported Android Things board. You can manually specify the port name by adding the following meta-data tag in your application manifest, where the value corresponds to the I2C bus the RTC module is attached to:
<meta-data android:name="ds3231_i2c_port" android:value="I2C1" />
Copyright 2018 Roberto Leinardi
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.