Android In App Review

Jan 28 2021 Kotlin 1.4, Android 5, Android Studio 4

Part 1: Implementing In App Review

5. Provide Dependencies

Lesson Complete

Play Next Lesson
Next
Save for later
About this episode
See forum comments
Cinema mode Mark as Complete Download course materials
Previous episode: 4. Store Review Preferences Next episode: 6. Implement The In App Review Manager

This video was last updated on Jan 28 2021

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

Whenever you have multiple objects you need to create and pass around the application, you generally speak about something called dependency injection and dependency graphs.

@Module
@InstallIn(ApplicationComponent::class)
class InAppReviewProviders {

}
@Provides
@Singleton
fun provideInAppReviewPreferences(@ApplicationContext context: Context): SharedPreferences {
  return context.getSharedPreferences(KEY_IN_APP_REVIEW_PREFERENCES, Context.MODE_PRIVATE)
}

@Provides
@Singleton
fun provideReviewManager(@ApplicationContext context: Context): ReviewManager {
  return ReviewManagerFactory.create(context)
}
@Module
@InstallIn(ApplicationComponent::class)
abstract class InAppReviewBinds {

}
@Binds
@Singleton
abstract fun bindInAppReviewPreferences(
  inAppReviewPreferencesImpl: InAppReviewPreferencesImpl
): InAppReviewPreferences