vaibhav chugh's Projects
This is a list of all awesome and useful android studio plugins.
Dagger2 - Part-2 In Java.
@Dagger 2- In this android application, I have used java language to give more understanding in which I use only @field injector, @constructor injector, and @method injector.
Use this Approach for adding new Arraylist in Hashmap.
A new java.util.stream has been added in Java 8 to perform filter/map/reduce like operations with the collection. Stream API will allow sequential as well as parallel execution. This is one of the best feature for me because I work a lot with Collections and usually with Big Data, we need to filter out them based on some conditions. Collection interface has been extended with stream() and parallelStream() default methods to get the Stream for sequential and parallel execution. Let’s see their usage with simple example.
As we know interface cannot not have method body.From java 8,interface are enhance to have method with implementation. we can use default and static keyword to create interfaces with method implementations. We know that java doesn't have multiple inheritance in classes because it leads to Diamond Problem. so how it will be handle interfaces now.since interfaces are now similar to abstract class.
Whenever we need to traverse through a Collection, we need to create an Iterator whose whole purpose is to iterate over and then we have business logic in a loop for each of the elements in the Collection. We might get ConcurrentModificationException if iterator is not used properly. Java 8 has introduced forEach method in java.lang.Iterable interface so that while writing code we focus on business logic only. forEach method takes java.util.function.Consumer object as argument, so it helps in having our business logic at a separate location that we can reuse. Let’s see forEach usage with simple example.
This project is based on the MVVM and Repository Design pattern.