This repository was archived by the owner on Dec 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update minSdk * Kotlin 1.6.10 * migrate to Kotlin DSL * Gradle 7.3.3 * AGP 7.1.1 * update Project name * add dokka * hide internal functions * add README * setup jitpack
- Loading branch information
Showing
16 changed files
with
175 additions
and
104 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# ktor-client-cronet-engine | ||
|
||
Ktor engine implementation using [Cronet](https://developer.android.com/guide/topics/connectivity/cronet) as backend which enables HTTP/3 with [ktor-client](https://ktor.io/docs/getting-started-ktor-client.html). | ||
|
||
THIS IS **NOT** AN OFFICIAL IMPLEMENTATION. | ||
|
||
Still very early stage. Currently simple `GET` request is only supported. | ||
|
||
## Add dependencies | ||
|
||
TODO | ||
|
||
## Create the client | ||
|
||
```kotlin | ||
val client = HttpClient( | ||
engine = Cronet.create { | ||
context = applicationContext | ||
config = { // this: CronetEngine.Builder | ||
enableBrotli(true) | ||
enableQuic(true) | ||
} | ||
} | ||
) | ||
``` | ||
|
||
You can pass existing CronetEngine instead. | ||
|
||
```kotlin | ||
val client = HttpClient( | ||
engine = Cronet.create { | ||
preconfigured = CronetEngine.Builder(applicationContext) | ||
.enableBrotli(true) | ||
.enableQuic(true) | ||
.build() | ||
} | ||
) | ||
``` |
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
plugins { | ||
id("com.android.application") | ||
id("org.jetbrains.kotlin.android") | ||
} | ||
|
||
android { | ||
compileSdk = 31 | ||
|
||
defaultConfig { | ||
applicationId = "com.niusounds.cronettest" | ||
minSdk = 16 | ||
targetSdk = 31 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
buildFeatures { | ||
viewBinding = true | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":cronet-engine")) | ||
implementation("io.ktor:ktor-client-core:1.6.7") | ||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.4.0") | ||
|
||
implementation("com.google.android.gms:play-services-cronet:18.0.1") | ||
implementation("androidx.core:core-ktx:1.7.0") | ||
implementation("androidx.appcompat:appcompat:1.4.1") | ||
implementation("com.google.android.material:material:1.5.0") | ||
implementation("androidx.constraintlayout:constraintlayout:2.1.3") | ||
testImplementation("junit:junit:4.13.2") | ||
androidTestImplementation("androidx.test.ext:junit:1.1.3") | ||
androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0") | ||
} |
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
plugins { | ||
id("com.android.application") version "7.1.1" apply false | ||
id("com.android.library") version "7.1.1" apply false | ||
id("org.jetbrains.kotlin.android") version "1.6.10" apply false | ||
id("org.jetbrains.dokka") version "1.6.10" apply false | ||
} | ||
|
||
tasks.create<Delete>("clean") { | ||
delete(rootProject.buildDir) | ||
} |
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
plugins { | ||
id("com.android.library") | ||
id("org.jetbrains.kotlin.android") | ||
id("maven-publish") | ||
id("org.jetbrains.dokka") | ||
} | ||
|
||
group = "com.github.niusounds" | ||
version = "0.0.1" | ||
|
||
android { | ||
compileSdk = 31 | ||
|
||
defaultConfig { | ||
minSdk = 16 | ||
targetSdk = 31 | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles("consumer-rules.pro") | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation("io.ktor:ktor-client-core:1.6.7") | ||
implementation("com.google.android.gms:play-services-cronet:18.0.1") | ||
} | ||
|
||
afterEvaluate { | ||
publishing { | ||
publications { | ||
create<MavenPublication>("release") { | ||
from(components.findByName("release")) | ||
} | ||
} | ||
} | ||
} |
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
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Fri Feb 04 22:07:56 JST 2022 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip | ||
distributionPath=wrapper/dists | ||
zipStorePath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME |
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,2 @@ | ||
jdk: | ||
- openjdk11 |
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