Android Flashcards

1
Q

OOP Concepts.

A

Object-Oriented Programming is a methodology of designing a program using classes, objects, inheritance, polymorphism, abstraction, and encapsulation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Inheritance

A

defined as deriving new classes (sub classes) from existing ones (super class or base class) and forming them into a hierarchy of classes.an object created through inheritance (a “child object”) acquires all the properties and behaviors of the parent object (except: constructors, destructor, overloaded operators and friend functions of the base class)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

polymorphism

A

the use of a single symbol to represent multiple different types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Abstraction

A

only the general states and behaviors are taken and more specific states and behaviors are left aside for the implementers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Encapsulation

A

Encapsulation is an OOPS concept to create and define the permissions and restrictions of an object and its member variables and methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

constructor

A
A constructor is a method used to initialize the state of an object, and it gets invoked at the time of object creation. 
Constructor Name should be same as class name.
A constructor must have no return type.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

destructor

A

A destructor is a method which is automatically called when the object is made of scope or destroyed. Destructor name is also same as class name but with the tilde symbol before the name.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Function overloading

A

Function overloading an as a normal function, but it can perform different tasks. It allows the creation of several methods with the same name which differ from each other by the type of input and output of the function.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

types of arguments

A

Call by Value – Value passed will get modified only inside the function, and it returns the same value whatever it is passed it into the function.
Call by Reference – Value passed will get modified in both inside and outside the functions and it returns the same or different value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

ternary operator

A

?: is a ternary operator that is part of the syntax for basic conditional expressions in several programming languages.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

super

A

a reference variable which is used to refer immediate parent class object,method or constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

interface

A

It is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Difference between overloading and overriding

A

Overloading is nothing but the same method with different arguments, and it may or may not return the same value in the same class itself.

Overriding is the same method names with same arguments and return types associated with the class and its child class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

THIS

A

THIS pointer refers to the current object of a class. THIS keyword is used as a pointer which differentiates between the current object with the global object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Static polymorphism and Dynamic polymorphism

A

Static polymorphism in Java is achieved by method overloading

Dynamic polymorphism in Java is achieved by method overriding

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

android spp components

A

An activity represents a single screen with a user interface,in-short Activity performs actions on the screen
A service is a component that runs in the background to perform long-running operations.
Broadcast Receivers simply respond to broadcast messages from other applications or from the system.
A content provider component supplies data from one application to others on request. Such requests are handled by the methods of the ContentResolver class

17
Q

context

A

An Android Context is an Interface (in the general sense, not in the Java sense; in Java, Context is actually an abstract class!) that allows access to application specific resources and class and information about application environment.

18
Q

AndroidManifest.xml

A

The AndroidManifest.xml file contains information of your package, including components of the application

19
Q

Application class

A

The Application class in Android is the base class within an Android app that contains all other components such as activities and services

20
Q

diff activity and fragments

A

Activity is an application component which give user interface where user can interect. Fragment is a part of an activity,which contibute its own UI to that activity.
Activity is not dependent on fragment.but Fragment is dependent on Activity,it can’t exist independentaly.

21
Q

Communicate with other fragments

A

getSupportFragmentManager().findFragmentById(R.id.article_fragment);

22
Q

View

A

View objects are the basic building blocks of User Interface(UI) elements in Android.
View is a simple rectangle box which responds to the user’s actions.
Examples are EditText, Button, CheckBox etc..
View refers to the android.view.View class, which is the base class of all UI classes.

23
Q

ViewGroup

A

ViewGroup is the invisible container. It holds View and ViewGroup
For example, LinearLayout is the ViewGroup that contains Button(View), and other Layouts also.
ViewGroup is the base class for Layouts

24
Q

custom view

A

For drawing view use the onDraw() method. In this method you receive a Canvas object which allows you to perform drawing operations on it

25
Q

SurfaceView

A

Provides a dedicated drawing surface embedded inside of a view hierarchy.

26
Q

layout types

A

LinearLayout means you can align views one by one (vertically/ horizontally).

RelativeLayout means based on relation of views from its parents and other views.

ConstraintLayout is similar to a RelativeLayout in that it uses relations to position and size widgets, but has additional flexibility and is easier to use in the Layout Editor.

WebView to load html, static or dynamic pages.

FrameLayout to load child one above another, like cards inside a frame, we can place one above another or anywhere inside the frame.

deprecated - AbsoluteLayout means you have to give exact position where the view should be.

Table Layout: A layout that arranges its children into rows and columns

27
Q

List View

A

Pros:

simple usage
default adapters
available OnItemClickListener
it’s the foundation of the ExpandableListView
Cons:

doesn’t embrace the usage of the ViewHolder pattern

28
Q

Recycle View

A

Pros:

integrated animations for adding, updating and removing items
enforces the recycling of views by using the ViewHolder pattern
supports both grids and lists
supports vertical and horizontal scrolling
can be used together with DiffUtil

Cons:

adds complexity
no OnItemClickListener

29
Q

view holder

A

ViewHolder pattern is solely to reduce the number of view.findViewById(int) calls you make.

30
Q

intent

A

An Intent is a messaging object you can use to request an action from another app component.

31
Q

intent types

A
Explicit intents specify which application will satisfy the intent, by supplying either the target app's package name or a fully-qualified component class name. You'll typically use an explicit intent to start a component in your own app, because you know the class name of the activity or service you want to start. For example, you might start a new activity within your app in response to a user action, or start a service to download a file in the background.
Implicit intents do not name a specific component, but instead declare a general action to perform, which allows a component from another app to handle it. For example, if you want to show the user a location on a map, you can use an implicit intent to request that another capable app show a specified location on a map.
32
Q

intent filter

A

An intent filter is an expression in an app’s manifest file that specifies the type of intents that the component would like to receive.

33
Q

Sticky Intent

A

Sticky Intent is also a type of Intent which allows a communication between function and a service sendStickyBroadcast() performs a sendBroadcast(Inent) know as sticky,the Intent your are sending stays around after the broadcast is complete,

34
Q

PendingIntent

A

By giving a PendingIntent to another application, you are granting it the right to perform the operation you have specified as if the other application was yourself

35
Q

job scheduler

A

The JobScheduler API allows you to specify robust conditions for executing tasks, along with centralized task

36
Q

diff service and intent service

A

A Service is an application component representing either an application’s desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use.

IntentService, which is a direct subclass of Service is borned to make things easier. The IntentService is used to perform a certain task in the background. Once done, the instance of IntentService terminate itself automatically.