-
What is the use-case of @BindsInstance Annotation?
- @BindsInstance is used to bind the available data at the time building the Component. Suppose I have user name available before building a component then I can use as shown in the following example: https://google.github.io/dagger/users-guide.html#binding-instances
-
What is the use-case of @Module Annotation?
- @Module is the Annotation used on the class for the Dagger to look inside it, to provide dependencies. We may be declaring methods inside the module class that are enclosed with @Provides annotation.
-
What is the use-case of @Provides Annotation?
- @Provides annotation is used on a method in Module class and can return / provide a Dependency object.
-
What is the use-case of @Component Annotation?
- @Component is used on Interface or abstract class. Dagger uses this interface to generate an implementation class with fully formed, dependency injected implementation, using the modules declared along with it. This generated class will be preceded by Dagger. For example if i create an interface named ProgramComponent with @Component annotation, Dagger will generate a Class named 'DaggerProgramComponent' implementing the ProgramComponent interface.
-
What is the use-case of @Scope Annotation?
- @Scope is an annotation used on Interface to create a new Custom Scope. A Scope declaration helps to keep single instance of a class as long as its scope exists. For example, in Android, we can use @ApplicationScope for the object to live as long as the Application is live or @ActivityScope for the object to be available till the activity is killed.
-
What is the use of Qualifier in Dagger?
- We are often in a situation where we will be needing multiple objects with different instance values. For example, we need declare Student("Vamsi") and Student("Krishna"). In such case we can use a Qualifier to tell Dagger that we need multiple instances of same class. The default implementation of Qualifier is using @Named annotation, for eg., @Named("student_vamsi") and @Named("student_krishna") If we want to create a Custom Qualifier we would be using @Qualifier to declare a custom Qualifier interface.
-
What is the use-case of @Inject Annotation in Dagger?
- @Inject annotation is used to request dagger to provide the respective Object. We use @Inject on Constructor, Fields (mostly where constructor is not accessible like Activities, Fragments, etc.) and Methods.
-
Why do we use the Dependency Injection Framework like Dagger in Android? - Learn more here
-
How does the Dagger work? - Learn more here and here
-
What is Component in Dagger? - Learn more here
-
What is Module in Dagger? - Learn more here
-
How does the custom scope work in Dagger?
- RXJava - What is it?
-
What is an Observable in RXJava2?
- An Observable simply emits the data to those which subscribed to it. All the emission is done asynchronously to the subscribers. A simple Observable can be created as follows:
// RxAndroid Tutorial - Adding Observable Observable<String> stringObservable = Observable.just("Hello Reactive Programming!");
-
What is an Observer in RXJava2?
- Observer consumes the data emitted by the Observable. To do this, Observer needs to subscribe to the Observable. Example shows how to create an Observable in RxJava2.
// RxAndroid Tutorial - Adding observer Observer<String> stringObserver = new Observer<String>() { @Override public void onSubscribe(Disposable d) { } @Override public void onNext(String s) { Toast.makeText(MainActivity.this, s, Toast.LENGTH_SHORT).show(); } @Override public void onError(Throwable e) { } @Override public void onComplete() { } };
-
How to Subscribe / Unsubscribe in RXJava?
- We can make an Observer to subscribe to Observable as follows:
// RxAndroid tutorial - observer subscribing to observable stringObservable.subscribe(stringObserver);
-
Map vs FlatMap
- Map transforms the items emitted by an Observable by applying a function to each item.
- FlatMap transforms the items emitted by an Observable into Observables.
-
What are the different types of Observables in RxJava?
- Single
- Maybe
- Completable
- Observable
- Flowable
-
What is a Single in RxJava?
- A Single in RxJava is an Observable which emits only one item if completed or returns error.
-
What is Maybe in RxJava?
- A Maybe in RxJava is used when the Observable needs to emit a value or a no value or an error.
-
What is Completable in RxJava?
- A Completable in RxJava is an Observable which just completes the task and does not emit anything if completed. It returns an error if anything fails. It is similar to reactive concept of runnable.
-
What is Back Pressure in RxJava?
- Back Pressure is the state where your observable (publisher) is creating more events than your subscriber can handle.
-
What is Flowable in RxJava?
- A Flowable in RxJava is used when the Observable emits more data than the Observer can consume. In Other words, Flowable can handle back pressure where as an Observable cannot.
-
What is a Cold Observable?
- A Cold Observable is an Observable that does not emit items until a Subscriber subscribes. If we have more than one Subscriber, then the Cold Observable will emit each sequence of items to all Subscribers one by one.
-
What is a Hot Observable?
- A Hot observable is an Observer that will emit items
-
List RxJava operators.
-
Hot Observables vs Cold Observables
-
Explain about reactive programming?
-
FlatMap Vs Map Operator - Learn more here
-
When to use
Create
operator and when to usefromCallable
operator of RxJava? - Learn more here -
When to use
defer
operator of RxJava? - Learn more here -
How are Timer, Delay, and Interval operators used in RxJava? - Learn more here
-
How to make two network calls in parallel using RxJava? - Learn more here
-
Tell the difference between Concat and Merge. - Learn more here
-
Explain Subject in RxJava? - Learn more here
-
What are the types of Observables in RxJava? - Learn more here
-
How to implement EventBus with RxJava? - Learn more here
-
How to implement search feature using RxJava in your application? - Learn more here
-
How The Android Image Loading Library Glide and Fresco Works? - Learn more here
-
Difference between Schedulers.io() and Schedulers.computation() in RxJava.
-
When to call dispose and clear on CompositeDisposable in RxJava? - Learn more here
-
What is Multipart Request in Networking? - Learn more here