Back to project page DistributedMemory.
The source code is released under:
Apache License
If you think the Android project DistributedMemory listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.faudroids.distributedmemory.common; /*from w w w . ja v a 2s .c om*/ import android.app.NotificationManager; import android.content.Context; import android.net.ConnectivityManager; import android.net.nsd.NsdManager; import android.net.wifi.WifiManager; import android.os.Looper; import javax.inject.Singleton; import dagger.Module; import dagger.Provides; @Module( library = true ) public final class CommonModule { private final Context context; public CommonModule(Context context) { this.context = context; } @Provides @Singleton Context provideApplicationContext() { return context; } @Provides @Singleton Looper provideMainLooper(Context context) { return context.getMainLooper(); } @Provides @Singleton NotificationManager provideNotificationManager(Context context) { return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); } @Provides @Singleton NsdManager provideNsdManager(Context context) { return (NsdManager) context.getSystemService(Context.NSD_SERVICE); } @Provides @Singleton ConnectivityManager provideConnectivityManager(Context context) { return (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); } @Provides @Singleton WifiManager provideWifiManager(Context context) { return (WifiManager) context.getSystemService(Context.WIFI_SERVICE); } }