forked from NightscoutFoundation/xDrip
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'NightscoutFoundation:master' into master
- Loading branch information
Showing
1,164 changed files
with
31,723 additions
and
8,031 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Quick Start | ||
|
||
### Currently Recommended IDE | ||
|
||
Android Studio Giraffe | 2022.3.1 Patch 3 | ||
|
||
|
||
### Lombok Plugin | ||
|
||
Until we are using Android Studio Iguana (where the lombok regression is believed to be corrected) you will need to manually install the lombok plugin jar from the etc source tree folder. | ||
|
||
To install it you go to Settings -> Plugins -> Cog icon -> Install plugin from disk -> select the lombok-giraffe.jar file | ||
|
||
### Android Studio Bugs and Regressions | ||
|
||
Be aware that each new version of Android Studio introduces more regressions and bugs. There are still uncorrected bugs which were introduced back in version 3.6! Also each IDE version is tightly coupled with various versions of gradle which are also tightly coupled with various versions of the Android framework tools. | ||
|
||
What this means, is that even though the command line compilation always works fine, any single version of Android Studio is unable to compile the entire xDrip source tree history and is likely to break in misleading and confusing ways based on simple dependency changes as there is such poor support in Android Studio for forward or backwards compatibility. | ||
|
||
Expect to have to run multiple different versions of Android Studio over time or where in the commit history you may be working from and for each new version to potentially introduce new and unpredictable issues. Expect to have to clear cache and restart to avoid being misled about the source of errors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
# Integration with xDrip+ via Broadcast Intent | ||
|
||
## Overview | ||
This documentation provides guidance on how to send a broadcast intent from a third-party Android application to insert a glucose sensor record into the xDrip application. There are a few different broadcast receivers but this documents the Nightscout Emulation receiver just for glucose records. | ||
|
||
## Sending a Broadcast Intent | ||
To insert a glucose sensor record into xDrip, construct and send a broadcast intent with specific parameters as described below. | ||
|
||
### Intent Action | ||
Use the following intent action when constructing the intent: | ||
```java | ||
Intent intent = new Intent("com.eveningoutpost.dexdrip.NS_EMULATOR"); | ||
``` | ||
|
||
### Intent Package | ||
To ensure the intent is received only by xDrip and to be allowed on Android 8+, specify the package name: | ||
```java | ||
intent.setPackage("com.eveningoutpost.dexdrip"); | ||
``` | ||
|
||
### Extra Parameters | ||
Add extra parameters to the intent for the data collection and JSON payload containing the sensor readings. | ||
|
||
- Collection: Indicate the type of data collection using the key `"collection"` with the value `"entries"`. | ||
- Data: Provide the glucose sensor readings in a JSON array format with the key `"data"`. | ||
|
||
### JSON Payload Structure | ||
Construct the JSON payload with the glucose sensor readings as follows: | ||
- Each reading should be a JSON object with the following attributes: | ||
- `"type"`: Set to `"sgv"` for sensor glucose value record. | ||
- `"date"`: The timestamp of the reading in milliseconds since epoch. | ||
- `"sgv"`: The glucose value in mg/dL. | ||
- `"direction"`: The rate of change of the glucose value, represented by a string such as `"SingleUp"`. Refer to `BgReading.slopeFromName()` for possible values. | ||
|
||
Here is an example JSON payload with a single reading: | ||
```java | ||
final JSONArray sgv_array = new JSONArray(); | ||
final JSONObject sgv_object = new JSONObject(); | ||
sgv_object.put("type", "sgv"); | ||
sgv_object.put("date", 1526817691000.0); | ||
sgv_object.put("sgv", 158); | ||
sgv_object.put("direction", "SingleUp"); | ||
sgv_array.put(sgv_object); | ||
intent.putExtra("data", sgv_array.toString()); | ||
``` | ||
|
||
A code example of this is in the unit test source tree in `NSEmulatorReceiverTest.bgReadingExampleBroadcast()` | ||
|
||
### Sending the Intent | ||
After constructing the intent, use `sendBroadcast()` to send it: | ||
```java | ||
context.sendBroadcast(intent); | ||
``` | ||
|
||
## Testing the Integration | ||
For testing purposes, make sure you set xDrip `Hardware Data Source` to `640G / Eversense` to enable the receiver. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### Kotlin Policy | ||
|
||
xDrip supports both Java and Kotlin source files. | ||
|
||
New class files in Java or Kotlin are accepted but there is no intention to convert existing Java files to Kotlin. | ||
|
||
Kotlin classes should be mindful to maintain as much java compatibility as possible where they may need to interact with existing classes. | ||
|
||
Overhead in terms of additional libraries and any performance related issues (such as threading and component lifecycle) should be carefully monitored. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.