Skip to content

Commit d2df602

Browse files
committed
1. Add firebase crashlytics and performance monitoring
2. Upgrade AGP to 7.0.2 3. Rename package and files to remove `TvMaze` reference 4. Add Firebase analytics
1 parent 2b32f83 commit d2df602

File tree

65 files changed

+518
-322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+518
-322
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,6 @@ captures/
4444
ehthumbs.db
4545
Thumbs.db
4646

47-
*.hprof
47+
*.hprof
48+
tvflix-*.json
49+
tester-groups.txt

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ There are several articles written on this repository which state the design and
3535
The TvFlix complete repository has been re-written in Kotlin with Coroutines covering
3636
Unit Tests across ViewModels and UI tests for the app.
3737
Know more:
38-
[Kotlin Everywhere. Coroutines, Tests, Robots and much more…](https://proandroiddev.com/kotlin-everywhere-coroutines-tests-robots-and-much-more-b02030206cc9)
38+
[Kotlin Everywhere. Coroutines, Tests, Robots and much more…](https://proandroiddev.com/kotlin-everywhere-coroutines-tests-robots-and-much-more-b02030206cc9)
3939

4040
### MVVM using Android Architecture Components
4141

app/build.gradle.kts

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ plugins {
44
kotlin("kapt")
55
kotlin("plugin.parcelize")
66
id("dagger.hilt.android.plugin")
7+
id("com.google.gms.google-services")
8+
id("com.google.firebase.crashlytics")
9+
id("com.google.firebase.firebase-perf")
10+
id("com.google.firebase.appdistribution")
711
}
812

913
apply {
@@ -12,7 +16,7 @@ apply {
1216
}
1317

1418
android {
15-
compileSdkVersion(Deps.Versions.compile_sdk)
19+
compileSdk = Deps.Versions.compile_sdk
1620

1721
buildFeatures {
1822
viewBinding = true
@@ -22,8 +26,8 @@ android {
2226

2327
defaultConfig {
2428
applicationId = "com.android.tvflix"
25-
minSdkVersion(Deps.Versions.min_sdk)
26-
targetSdkVersion(Deps.Versions.target_sdk)
29+
minSdk = Deps.Versions.min_sdk
30+
targetSdk = Deps.Versions.target_sdk
2731
versionCode = Deps.Versions.app_version_code
2832
versionName = Deps.Versions.app_version_name
2933
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
@@ -40,19 +44,28 @@ android {
4044
}
4145
}
4246
}
43-
flavorDimensions("default")
47+
flavorDimensions.addAll(listOf("default"))
4448
productFlavors {
4549
create("prod") {
50+
dimension = "default"
4651
applicationId = "com.android.tvflix"
52+
firebaseAppDistribution {
53+
releaseNotesFile = "release-notes.txt"
54+
groupsFile = "tester-groups.txt"
55+
serviceCredentialsFile = "tvflix-b45cd-5fa9e2fb3108.json"
56+
}
4757
}
4858
create("dev") {
49-
applicationId = "com.android.tvflix.dev"
59+
dimension = "default"
60+
applicationId = "com.android.tvflix"
61+
firebaseAppDistribution {
62+
releaseNotesFile = "release-notes.txt"
63+
groupsFile = "tester-groups.txt"
64+
serviceCredentialsFile = "tvflix-b45cd-5fa9e2fb3108.json"
65+
}
5066
}
5167
}
5268
buildTypes {
53-
getByName("debug") {
54-
applicationIdSuffix = ".debug"
55-
}
5669
getByName("release") {
5770
isMinifyEnabled = true
5871
isShrinkResources = true
@@ -64,8 +77,8 @@ android {
6477
}
6578
}
6679
compileOptions {
67-
sourceCompatibility = JavaVersion.VERSION_1_8
68-
targetCompatibility = JavaVersion.VERSION_1_8
80+
sourceCompatibility = JavaVersion.VERSION_11
81+
targetCompatibility = JavaVersion.VERSION_11
6982
}
7083

7184
testOptions {
@@ -84,17 +97,21 @@ android {
8497
testBuildType = "debug"
8598

8699
packagingOptions {
87-
exclude("META-INF/ASL2.0")
88-
exclude("META-INF/DEPENDENCIES")
89-
exclude("META-INF/NOTICE")
90-
exclude("META-INF/LICENSE")
91-
exclude("META-INF/LICENSE.txt")
92-
exclude("META-INF/NOTICE.txt")
93-
exclude(".readme")
100+
resources.excludes.addAll(
101+
listOf(
102+
"META-INF/ASL2.0",
103+
"META-INF/DEPENDENCIES",
104+
"META-INF/NOTICE",
105+
"META-INF/LICENSE",
106+
"META-INF/LICENSE.txt",
107+
"META-INF/NOTICE.txt",
108+
".readme"
109+
)
110+
)
94111
}
95112

96113
kotlinOptions {
97-
jvmTarget = "1.8"
114+
jvmTarget = "11"
98115
}
99116
}
100117

@@ -115,9 +132,6 @@ dependencies {
115132
kapt(Deps.AndroidX.Room.compiler)
116133
testImplementation(Deps.AndroidX.Room.testing)
117134
implementation(Deps.AndroidX.Room.ktx)
118-
implementation(Deps.AndroidX.Hilt.viewmodel)
119-
kapt(Deps.AndroidX.Hilt.compiler)
120-
implementation(Deps.AndroidX.multidex)
121135
implementation(Deps.AndroidX.annotation)
122136
// end-region AndroidX
123137

@@ -162,6 +176,14 @@ dependencies {
162176

163177
implementation(Deps.Hilt.android)
164178
kapt(Deps.Hilt.android_compiler)
179+
180+
// start-region Firebase
181+
implementation(platform(Deps.Firebase.firebase_bom))
182+
implementation(Deps.Firebase.crashlytics)
183+
implementation(Deps.Firebase.performance_monitoring)
184+
implementation(Deps.Firebase.analytics)
185+
implementation(Deps.Firebase.remote_config)
186+
// end-region Firebase
165187
}
166188

167189

app/google-services.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"project_info": {
3+
"project_number": "352317035381",
4+
"project_id": "tvflix-b45cd",
5+
"storage_bucket": "tvflix-b45cd.appspot.com"
6+
},
7+
"client": [
8+
{
9+
"client_info": {
10+
"mobilesdk_app_id": "1:352317035381:android:d68e4d8178aaa27e62793c",
11+
"android_client_info": {
12+
"package_name": "com.android.tvflix"
13+
}
14+
},
15+
"oauth_client": [
16+
{
17+
"client_id": "352317035381-gknu987p38ks98itjcds99pehar6539u.apps.googleusercontent.com",
18+
"client_type": 3
19+
}
20+
],
21+
"api_key": [
22+
{
23+
"current_key": "AIzaSyDomD9NnOHReomJXzki3akzw9M_JZ--DyU"
24+
}
25+
],
26+
"services": {
27+
"appinvite_service": {
28+
"other_platform_oauth_client": [
29+
{
30+
"client_id": "352317035381-gknu987p38ks98itjcds99pehar6539u.apps.googleusercontent.com",
31+
"client_type": 3
32+
}
33+
]
34+
}
35+
}
36+
}
37+
],
38+
"configuration_version": "1"
39+
}

app/src/androidTest/java/com/android/tvmaze/home/HomeRobot.kt renamed to app/src/androidTest/java/com/android/tvflix/home/HomeRobot.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.android.tvmaze.home
1+
package com.android.tvflix.home
22

33
import android.app.Activity
44
import androidx.test.espresso.Espresso.onView
@@ -9,9 +9,9 @@ import androidx.test.espresso.matcher.RootMatchers.withDecorView
99
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
1010
import androidx.test.espresso.matcher.ViewMatchers.withId
1111
import androidx.test.espresso.matcher.ViewMatchers.withText
12-
import com.android.tvmaze.R
13-
import com.android.tvmaze.utils.MatcherUtils
14-
import com.android.tvmaze.utils.ViewActionUtils
12+
import com.android.tvflix.R
13+
import com.android.tvflix.utils.MatcherUtils
14+
import com.android.tvflix.utils.ViewActionUtils
1515
import org.hamcrest.Matchers.`is`
1616
import org.hamcrest.Matchers.allOf
1717
import org.hamcrest.Matchers.not

app/src/androidTest/java/com/android/tvmaze/home/HomeTest.kt renamed to app/src/androidTest/java/com/android/tvflix/home/HomeTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package com.android.tvmaze.home
1+
package com.android.tvflix.home
22

33
import androidx.test.espresso.Espresso.pressBack
44
import androidx.test.espresso.IdlingRegistry
55
import androidx.test.ext.junit.runners.AndroidJUnit4
66
import androidx.test.filters.LargeTest
77
import androidx.test.rule.ActivityTestRule
8-
import com.android.tvmaze.idlingresource.LoadingIdlingResource
8+
import com.android.tvflix.idlingresource.LoadingIdlingResource
99
import org.junit.After
1010
import org.junit.Before
1111
import org.junit.Rule

app/src/androidTest/java/com/android/tvmaze/idlingresource/LoadingIdlingResource.kt renamed to app/src/androidTest/java/com/android/tvflix/idlingresource/LoadingIdlingResource.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package com.android.tvmaze.idlingresource
1+
package com.android.tvflix.idlingresource
22

33
import android.app.Activity
44
import android.view.View
55
import android.widget.ProgressBar
66
import androidx.test.espresso.IdlingResource
7-
import com.android.tvmaze.R
7+
import com.android.tvflix.R
88

99
/**
1010
* An idling resource which checks which tells Espresso to wait until Progress Bar dismisses

app/src/androidTest/java/com/android/tvmaze/shows/AllShowsRobot.kt renamed to app/src/androidTest/java/com/android/tvflix/shows/AllShowsRobot.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
package com.android.tvmaze.shows
1+
package com.android.tvflix.shows
22

33
import androidx.test.espresso.Espresso.onView
44
import androidx.test.espresso.assertion.ViewAssertions.matches
55
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
66
import androidx.test.espresso.matcher.ViewMatchers.withId
77
import androidx.test.espresso.matcher.ViewMatchers.withText
8-
import com.android.tvmaze.R
9-
import com.android.tvmaze.utils.MatcherUtils
8+
import com.android.tvflix.R
9+
import com.android.tvflix.utils.MatcherUtils
1010

1111
fun launchAllShows(func: AllShowsRobot.() -> Unit) = AllShowsRobot().apply { func() }
1212
class AllShowsRobot {

app/src/androidTest/java/com/android/tvmaze/shows/AllShowsTest.kt renamed to app/src/androidTest/java/com/android/tvflix/shows/AllShowsTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
package com.android.tvmaze.shows
1+
package com.android.tvflix.shows
22

33
import androidx.test.espresso.IdlingRegistry
44
import androidx.test.ext.junit.runners.AndroidJUnit4
55
import androidx.test.filters.LargeTest
66
import androidx.test.rule.ActivityTestRule
7-
import com.android.tvmaze.idlingresource.LoadingIdlingResource
7+
import com.android.tvflix.idlingresource.LoadingIdlingResource
88
import org.junit.After
99
import org.junit.Before
1010
import org.junit.Rule

app/src/androidTest/java/com/android/tvmaze/utils/MatcherUtils.kt renamed to app/src/androidTest/java/com/android/tvflix/utils/MatcherUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.android.tvmaze.utils
1+
package com.android.tvflix.utils
22

33
import android.view.View
44
import androidx.recyclerview.widget.RecyclerView

0 commit comments

Comments
 (0)