Android Clean: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Line 14: Line 14:
*Maybes
*Maybes
This restricts the functions we need to implement.
This restricts the functions we need to implement.
==Dependency Injection==
This example shows use of DI. A brief reminder of Dagger.
*@Provider, a service
*@Module, group of providers
*@Component, group of modules

Revision as of 03:10, 31 January 2021

Notes to sort out

@SUPPRESS

This suppresses the depreciation at compile time

    @Suppress("DEPRECATION")
    val isConnected: Boolean
        get() = (context.getSystemService(Context.CONNECTIVITY_SERVICE) as? ConnectivityManager)?.run {

Completable

Because we are using java we have 3 types of observables,

  • Completables
  • Singles
  • Maybes

This restricts the functions we need to implement.

Dependency Injection

This example shows use of DI. A brief reminder of Dagger.

  • @Provider, a service
  • @Module, group of providers
  • @Component, group of modules