Decoding Dependency Injection

What is a dependency? A state in which one object depends on another object is term as Dependency or coupling. Example: When class X uses class Y, then X depends on Y. X can’t use independently without Y. X can’t be reused without resuing Y. X -> Dependant Y -> Dependency Dependency/Coupling are directional. X […]

Continue reading

Layouts and Container in Android

Layout It is subclasses of ViewGroup   LinearLayout It is a ViewGroup that aligns all child views in a single direction vertically or horizontally. Horizontal Vertical Relative Layout It is a ViewGroup that displays child views in relative positions. Table Layout It is a ViewGroup that group the views into rows and columns. Absolute Layout […]

Continue reading

View and View Group in Android

Let’s start with Activity, its a screen of an App, which is visible to users. An app can have several activities. Activity can have several GUI components. These GUI components are instances of View or ViewGroup. View It is a superclass for all GUI elements. Few common Views are: TextView ImageView EditText Button CheckBox ProgressBar […]

Continue reading

Layout Inflater

What is layout inflater? Converting XML appearance definition into view objects in code is called inflation Layout inflater is class that does this inflation. Layout inflater is an expensive operation, it takes a lot of time and resources to inflate. It takes XML view, creates its java object, set values for all attributes and recursively […]

Continue reading

Adapter in Android

The Android adapter is a bridge between the view(ex. listview, gridview etc ) and the underlying data for that view. Adapter manages the data and adapts the data to the individual rows of the view. 1)The Adapter provides access to the data items. 2)The Adapter is also responsible for making a View for each item […]

Continue reading

Interview Questions Level-4

What is the difference between Service, Async Task & Thread? Dig Deeper into Service, Async Task & Thread What will happen if user closes the activity, while still thread is running in the background.¬†Will that thread continue to run in background ? You can’t really predict. When to use service, thread, AsncTask Service Thread IntentService […]

Continue reading

Job Scheduler in Android

In some App’s, we have to perform tasks asynchronously and outside the scope of App life cycle like downloading files, updating App data, schedule backups, updating network resources. Some task executes instantaneously and some needs to be scheduled. To schedule background task android provides various APIs. Alarm Manager Job Scheduler GCM Network Manager Firebase Job […]

Continue reading

Context In Android

According to official documentation, Context Class is an interface to global information about an application environment. It’s an abstract class, whose implementation is provided by Android Os. It allows access to application-specific resources, classes and application-level operations such as launching activities, broadcasting and receiving intents, etc.   In simple term The Context provides the answer […]

Continue reading

GOF Design Pattern

Design pattern¬†is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn’t a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. The design pattern is categorised into three […]

Continue reading

Hashing

Suppose we want to store contact detail(name, phone number). What type of data structure would you use? The first obvious choice will array. If you are using an array, then searching will be of O(n) complexity. Then you might say, let’s go for the binary search, then its complexity will be log(n). Yes, searching efficient […]

Continue reading

A complete guide to Big O notation

Use to describe the complexity(performance) of an Algorithm. Big O describes the worst case scenario. It can be used for both time and space complexity. O(1): Constant Time An algorithm is said to run in constant time if it requires the same amount of time regardless of the input size. Examples: Example 1:

Example […]

Continue reading

Android Fragment Complete Tutorial

What is Android Fragment? Its a piece of UI, which is more modular than activity. It can also be called as Sub Activity. Fragment represents multiple screens in a single the activity. It can be added or removed while activity runs. Each fragment has its own lifecycle. Why Android Fragment? Reusable the same fragments across […]

Continue reading

Interview Questions Basic Level-2

AIDL? Android Interface Definition Language. It allows you to define the programming interface that both the client and server agree upon in order to communicate with each other using interprocess communication (IPC). On Android, one process cannot normally access the memory of another process. So inorder to talk, they need to decompose their objects into […]

Continue reading

What is AI ?

What is AI ?

All animals, humans exhibit some level of intelligence.
While all our machine lack this, they work on one simple principle, i.e.
if ‘x’ event takes place, do ‘y’ predefined work.

Continue reading
Artificial intelligence

Journey to Artificial intelligence begins

We are always fascinated by Artificial intelligence machine learning etc. Some people afraid that, it will take over the humans and control them as we do to animals, but everybody will agree that it will be the next big thing in the world.

This is the right time to be part it. Many of us want to but they unable because it is a topic which not mature enough, so people often find it difficult to learn or get resources.

Continue reading
Thread-looper-handler-AsyncTask

Thread looper handler AsyncTask in an easy way

All our code runs on UI Thread by default.
UI thread is also called as Main Thread.

The Main Tread is responsible for event handling, UI rendering etc.
If you are performing CPU intensive or time taking task on Main Thread, then it will not be able to handle the events or response of the user, As CPU is busy handling other works.

Continue reading

Binary Search Algorithm

Complexity: O(log(n)) Application: Use to find element in an Array. Algorithm:

  Code:

Download code

Continue reading

Linear Search Algorithm

Linear Search Algorithm complexity: O(n) Application: use to find element in an Array. Algorithm:

Code:

  Download code

Continue reading