fb-android-dagger alternatives and similar packages
Based on the "Utility" category.
Alternatively, view fb-android-dagger alternatives based on common mentions on social networks and blogs.
-
timber
A logger with a small, extensible API which provides utility on top of Android's normal Log class. -
ExpirableDiskLruCache
DISCONTINUED. Java implementation of a Disk-based LRU cache which specifically targets Android compatibility. -
Android-Templates-And-Utilities
Collection of source codes, utilities, templates and snippets for Android development. -
secure-preferences
DISCONTINUED. Android Shared preference wrapper than encrypts the values of Shared Preferences. It's not bullet proof security but rather a quick win for incrementally making your android app more secure. -
greenrobot-common
General purpose utilities and hash functions for Android and Java (aka java-common) -
Androl4b
A Virtual Machine For Assessing Android applications, Reverse Engineering and Malware Analysis -
vector-compat
A support library for VectorDrawable and AnimatedVectorDrawable classes introduced in Lollipop -
CastCompanionLibrary-android
DISCONTINUED. CastCompanionLibrary-android is a library project to enable developers integrate Cast capabilities into their applications faster and easier. -
motion
An Android library allowing images to exhibit a parallax effect that reacts to the device's tilt -
Colours
A beautiful set of predefined colors and a set of color methods to make your Android development life easier. -
Reservoir
DISCONTINUED. Android library to easily serialize and cache your objects to disk using key/value pairs.
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of fb-android-dagger or a related project?
README
fb-android-dagger
A set of helper classes for using dagger with Android components such as Applications, Activities, Fragments, BroadcastReceivers, and Services.
Maven users:
<dependency>
<groupId>com.fizz-buzz</groupId>
<artifactId>fb-android-dagger</artifactId>
<version>1.0.6</version>
</dependency>
Note: this project's POM specifies dependencies for the Android SDK and the support v4 library using the group IDs, artifact IDs, and version numbers created by the Maven Android SDK Deployer, as opposed to the ones in Maven Central, which contains artifacts that are unofficial and out of date. If you want to use the ones in Maven Central anyway, just update those dependencies in the POM.
Overview
fb-android-dagger provides a set of base classes for using dagger in Android applications. It follows a convention exemplified by Square's sample application, whereby a base class calls getModules() to gather the set of modules that its subclass(es) need to be part of the graph, then creates an object graph from those modules and injects itself.
The following classes are provided, each implementing this technique in the method indicated in parentheses:
InjectingApplication
(onCreate)InjectingBroadcastReceiver
(onReceive)InjectingAppWidgetProvider
(onReceive)InjectingService
(onCreate)InjectingActivity
(onCreate)InjectingActionBarActivity
(onCreate)InjectingFragmentActivity
(onCreate)InjectingPreferenceActivity
(onCreate)InjectingFragment
(onAttach)InjectingListFragment
(onAttach)InjectingDialogFragment
(onAttach)
The graphs
InjectingApplication
creates an application-scope graph.
InjectingBroadcastReciever
, InjectingAppWidgetProvider
, InjectingService
, and the various Injecting...Activity
classes each extend the application-scope graph with their own module(s), resulting in a graph scoped to their own component.
The various Injecting...Fragment
classes extend their corresponding activity's graph.
Modules
Each component type has an associated module:
InjectingActivityModule
InjectingServiceModule
InjectingBroadcastRecieverModule
InjectingActivityModule
InjectingFragmentModule
The last two are shared by the Injecting...Activity
classes and the Injecting...Fragment
classes, respectively. These modules define provider methods which enable injection of objects relevant to their component type. They all have a provider that returns the component itself in the form of an Injector interface:
public interface Injector {
public ObjectGraph getObjectGraph();
public void inject(Object target);
}
Qualifier annotations defined in the various modules allow for specific components' injectors to be accessed:
class Foo1 {
@Inject @Application Injector appInjector;
@Inject @Activity Injector activityInjector;
@Inject @Fragment Injector fragInjector;
//...
}
Application and Activity Contexts are similarly accessible:
class Foo2 {
@Inject @Application Context appContext;
@Inject @Activity Context activityContext;
// ...
}
...as are the typed components themselves:
class Foo3 {
@Inject Application theApp;
@Inject Activity myActivity;
@Inject Fragment myFragment;
// ...
}
Developed by
Andy Dennie - [email protected]
License
Copyright 2014 Fizz Buzz LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*Note that all licence references and agreements mentioned in the fb-android-dagger README section above
are relevant to that project's source code only.