Android Clean: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Created page with "=Notes to sort out= ==@SUPPRESS== This suppresses the depreciation at compile time <syntaxhighlight "kotlin"> @Suppress("DEPRECATION") val isConnected: Boolean..."
 
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:


</syntaxhighlight>
</syntaxhighlight>
==Dependency Injection==
This example shows use of DI. A brief reminder of Dagger.
*@Provider, a service
*@Module, group of providers
*@Component, group of modules

Latest revision as of 04:15, 10 February 2022

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 {

Dependency Injection

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

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