Skip to content

Commit 6f0280b

Browse files
authored
Updated to point to maven central artifacts (#8)
1 parent 9435334 commit 6f0280b

File tree

9 files changed

+83
-27
lines changed

9 files changed

+83
-27
lines changed

.idea/jarRepositories.xml

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,24 @@
22

33
The CommonHealth Client SDK provides an interface that allows applications to access health data stored in CommonHealth.
44

5-
The CommonHealth Client SDK is in closed beta. If you would like to participate in our beta program, please reach out to developers [at] commonhealth.org.
5+
The CommonHealth Client SDK is in open beta.
66

77
While we consider the SDK to be relatively stable, this is pre-release software, so the interfaces are subject to change based on evolving requirements and developer feedback. We're currently investigating ways to make it easier to remove configuration dependencies, so if you find anything particularly burdensome or confusing, please let us know by either emailing us or opening a Github issue.
88

99
## Audience
10-
This quick start guide is geared towards participants in our closed beta program. This guide assumes that you have the CommonHealth developer edition installed on your device and you have gone through the enrollment process in the application.
10+
This quick start guide is geared towards participants in our closed beta program. This guide assumes that you have CommonHealth Developer Edition installed on your device and you have gone through the enrollment process in the application.
11+
12+
## CommonHealth Developer Edition
13+
14+
CommonHealth Developer Edition is a specialized version of CommonHealth specifically for developers working with the CommonHealth Client SDK. CommonHealth Developer Edition integrates with the [SMART® Health IT Sandbox](https://launch.smarthealthit.org) to provide access to sample patient data. CommonHealth Developer Edition also relaxes some security features which allows the application to be installed and run on an Android emulator (in addition to a physical Android device).
15+
16+
### Installing the CommonHealth Developer Edition
17+
18+
CommonHealth Developer Edition is currently made available via an open testing track in the Google Play Store. You can join and install the app via [this link](https://play.google.com/store/apps/details?id=org.thecommonsproject.android.phr.developer) on your Android device or [this link](https://play.google.com/apps/testing/org.thecommonsproject.android.phr.developer) on the web.
19+
20+
### Running the CommonHealth Developer Edition
21+
22+
Once CommonHealth Developer Edition is installed, you will need to add a sample patient account in order to populate the app with sample data. After selecting the SMART IT Sandbox from the list of avaialble data sources, you will redirected to the SMART IT Sandbox and be presented with an authentication screen. Enter the sample patient's `ID` (e.g., `099e7de7-c952-40e2-9b4e-0face78c9d80`, `smart-1288992`) in the `User Id` field. The `Password` field is not checked and can be anything. A full list of sample patients can be found [here](https://patient-browser.smarthealthit.org/index.html?config=r2).
1123

1224
## Configuration Requirements
1325

@@ -16,13 +28,13 @@ This quick start guide is geared towards participants in our closed beta program
1628
The CommonHealth Client SDK consists of two modules: commonhealthclient and common. Commonhealthclient contains the bulk of functionality for the SDK, while common types shared between the CommonHealth application and the CommonHealth Client SDK. You'll need to add the following to your application's list of dependencies:
1729

1830
```
19-
implementation "org.thecommonsproject.commonhealth:common:0.4.8"
20-
implementation "org.thecommonsproject.commonhealth:commonhealthclient:0.4.8"
31+
implementation "org.thecommonsproject:commonhealth-common:1.1.2"
32+
implementation "org.thecommonsproject:commonhealth-client:1.1.2"
2133
```
2234

23-
The artifacts currently reside in our organization's bintray repo, but at some point these will be migrated to jcenter. In the mean time, you'll need to add the following maven repository to your list of repositories, typically defined in the project's `gradle.build` file:
35+
The release artifacts are made avalable via the Maven Central repository, so you will need to have the following in your list of dependency repositories:
2436

25-
`maven { url "https://dl.bintray.com/thecommonsproject/CommonHealth" }`
37+
`mavenCentral()`
2638

2739
Additionally, some dependency artifacts are served by Jitpack, so you will also need to add the following maven repository:
2840

@@ -121,10 +133,12 @@ To help with security, the `common` module provides `SecureNamespacedKeyValueSto
121133
The `SampleApplication` class contains the following code to create a `SecureNamespacedKeyValueStore`:
122134

123135
```
124-
val database = database ?: createDataBase(context)
136+
val cryptoProvider = DefaultCryptoProvider(DefaultAndroidKeystoreClientWrapper())
137+
val database = database ?: createDataBase(context, cryptoProvider)
125138
val namespacedKeyValueStore = SecureNamespacedKeyValueStore(
126139
KeyValueLocalDataStore(database.keyValueEntryDao()),
127-
"secure_namespaced_key_value_store"
140+
"secure_namespaced_key_value_store",
141+
cryptoProvider
128142
)
129143
```
130144

@@ -327,7 +341,17 @@ Upon receiving the NEW_DATA_AVAILABLE notification, you can invoke a method on t
327341

328342
## Registering with CommonHealth
329343

330-
Registering with CommonHealth is not required to begin testing integrations with CommonHealth. However, if you have a client application that you would like to use in production environments, you'll need to register the application with CommonHealth. This is similar to registering an OAuth client, where you would specify information such as required scope, authorization redirect URI, etc. Please reach out to developers [at] commonhealth.org for more information.
344+
Registering with CommonHealth is not required to begin testing integrations with CommonHealth Developer Edition. However, if you have a client application that you would like to use in staging or production environments, you'll need to register the application with CommonHealth. This is similar to registering an OAuth client, where you would specify information such as required scope, authorization redirect URI, etc. Please reach out to developers [at] commonhealth.org for more information.
345+
346+
## Upgrading from v0.4.8 to v1.1.2
347+
`v1.1.2` introduced a small number of changes:
348+
349+
- The constructor for `SecureNamespacedKeyValueStore` now requires a `CryptoProvider` object.
350+
- The artifacts names have changed:
351+
- `org.thecommonsproject.commonhealth:common` is now `org.thecommonsproject:commonhealth-common`
352+
- `org.thecommonsproject.commonhealth:commonhealthclient` is now `org.thecommonsproject:commonhealth-client`
353+
- The artifacts are now hosted in Maven Central.
354+
331355

332356
## Upgrading from v0.4.4 to v0.4.8
333357
`v0.4.8` introduced a number of large changes and enhancements to the API:

app/build.gradle

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ android {
3838
}
3939
}
4040

41+
configurations.all {
42+
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
43+
}
44+
4145
dependencies {
4246
implementation fileTree(dir: 'libs', include: ['*.jar'])
4347
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
@@ -54,14 +58,16 @@ dependencies {
5458
implementation "androidx.navigation:navigation-fragment-ktx:$navigationVersion"
5559
implementation "androidx.navigation:navigation-ui-ktx:$navigationVersion"
5660

57-
implementation"org.thecommonsproject.commonhealth:common:$commonHealthVersion"
58-
implementation"org.thecommonsproject.commonhealth:commonhealthclient:$commonHealthVersion"
61+
implementation "org.thecommonsproject:commonhealth-common:$commonHealthVersion"
62+
implementation "org.thecommonsproject:commonhealth-client:$commonHealthVersion"
63+
// FOR SNAPSHOT VERSIONS
64+
// implementation(group: "org.thecommonsproject", name: "commonhealth-common", version: commonHealthVersion, changing: true)
65+
// implementation(group: "org.thecommonsproject", name: "commonhealth-client", version: commonHealthVersion, changing: true)
5966

6067
//Room
6168
kapt "androidx.room:room-compiler:$roomVersion"
6269
implementation "androidx.room:room-runtime:$roomVersion"
6370
implementation "androidx.room:room-ktx:$roomVersion"
64-
// implementation "androidx.room:room-rxjava2:$roomVersion"
6571

6672
//for pretty printing json resources
6773
implementation "com.google.code.gson:gson:$gsonVersion"

app/src/main/java/org/thecommonsproject/android/commonhealth/sampleapp/SampleApplication.kt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import androidx.room.Room
66
import net.sqlcipher.database.SupportFactory
77
import org.thecommonsproject.android.common.keyvaluestore.SecureNamespacedKeyValueStore
88
import org.thecommonsproject.android.common.keyvaluestore.room.KeyValueLocalDataStore
9+
import org.thecommonsproject.android.common.util.CryptoProvider
910
import org.thecommonsproject.android.common.util.DatabasePassphraseManager
11+
import org.thecommonsproject.android.common.util.DefaultAndroidKeystoreClientWrapper
12+
import org.thecommonsproject.android.common.util.DefaultCryptoProvider
1013
import org.thecommonsproject.android.commonhealthclient.*
1114
import org.thecommonsproject.android.commonhealthclient.notification.CommonHealthNotification
1215
import timber.log.Timber
@@ -15,19 +18,20 @@ class SampleApplication: Application() {
1518

1619
private var database: SampleApplicationDatabase? = null
1720

18-
private fun getDatabasePassphrase(context: Context) : ByteArray {
21+
private fun getDatabasePassphrase(context: Context, cryptoProvider: CryptoProvider) : ByteArray {
1922
val passphraseFilePath = context.filesDir.absolutePath.plus("/encryptedDatabasePassphrase")
2023
val passphraseManager = DatabasePassphraseManager(
2124
passphraseFilePath,
2225
64,
23-
"passphrase_file"
26+
"passphrase_file",
27+
cryptoProvider
2428
)
2529

2630
return passphraseManager.getPassphrase()
2731
}
2832

29-
private fun createDataBase(context: Context): SampleApplicationDatabase {
30-
val passphrase = getDatabasePassphrase(context)
33+
private fun createDataBase(context: Context, cryptoProvider: CryptoProvider): SampleApplicationDatabase {
34+
val passphrase = getDatabasePassphrase(context, cryptoProvider)
3135
val supportFactory = SupportFactory(passphrase)
3236
val result = Room.databaseBuilder(
3337
context.applicationContext,
@@ -42,6 +46,7 @@ class SampleApplication: Application() {
4246

4347
private fun initializeCommonHealthStore(application: Application) {
4448

49+
val cryptoProvider = DefaultCryptoProvider(DefaultAndroidKeystoreClientWrapper())
4550
val context = application.applicationContext
4651
val notificationPreferences = NotificationPreferences(
4752
subscribedNotificationTypes = setOf(
@@ -78,10 +83,11 @@ class SampleApplication: Application() {
7883
notificationPreferences = notificationPreferences
7984
)
8085

81-
val database = database ?: createDataBase(context)
86+
val database = database ?: createDataBase(context, cryptoProvider)
8287
val namespacedKeyValueStore = SecureNamespacedKeyValueStore(
8388
KeyValueLocalDataStore(database.keyValueEntryDao()),
84-
"secure_namespaced_key_value_store"
89+
"secure_namespaced_key_value_store",
90+
cryptoProvider
8591
)
8692

8793
//if initialization fails, halt

app/src/main/java/org/thecommonsproject/android/commonhealth/sampleapp/fragments/CategoryListFragment.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import android.view.View
88
import android.view.ViewGroup
99
import android.widget.*
1010
import androidx.fragment.app.activityViewModels
11-
import androidx.lifecycle.observe
1211
import androidx.lifecycle.viewModelScope
1312
import androidx.navigation.fragment.findNavController
1413
import androidx.navigation.navOptions

app/src/main/java/org/thecommonsproject/android/commonhealth/sampleapp/fragments/ResourceListFragment.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import android.widget.ImageView
1010
import android.widget.ProgressBar
1111
import android.widget.TextView
1212
import androidx.fragment.app.activityViewModels
13-
import androidx.lifecycle.observe
1413
import androidx.navigation.fragment.findNavController
1514
import androidx.navigation.fragment.navArgs
1615
import androidx.navigation.navOptions

build.gradle

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
buildscript {
44

55
ext {
6-
kotlin_version = '1.3.72'
6+
kotlin_version = '1.4.32'
77
navigationVersion = "2.1.0-alpha02"
88
}
99

1010
repositories {
1111
google()
12-
jcenter()
12+
maven { url "https://jcenter.bintray.com" }
1313
}
1414
dependencies {
15-
classpath 'com.android.tools.build:gradle:4.0.1'
15+
classpath 'com.android.tools.build:gradle:4.2.1'
1616
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$navigationVersion"
1717
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1818
// NOTE: Do not place your application dependencies here; they belong
@@ -23,9 +23,11 @@ buildscript {
2323
allprojects {
2424
repositories {
2525
google()
26-
jcenter()
26+
mavenCentral()
27+
maven { url "https://jcenter.bintray.com" }
2728
maven { url 'https://jitpack.io' }
28-
maven { url "https://dl.bintray.com/thecommonsproject/CommonHealth" }
29+
// CH Snapshot repo
30+
// maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
2931
}
3032
}
3133

@@ -41,7 +43,7 @@ ext {
4143
targetSdkVersion = 29
4244
compileSdkVersion = 29
4345

44-
commonHealthVersion = '0.4.8'
46+
commonHealthVersion = '1.1.2'
4547

4648
appCompatVersion = '1.1.0'
4749
androidXVersion = '1.1.0'
@@ -59,3 +61,7 @@ ext {
5961
timberVersion = '4.7.1'
6062
sqlcipherVersion = '4.3.0'
6163
}
64+
65+
configurations.all {
66+
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
67+
}

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip

0 commit comments

Comments
 (0)