0% found this document useful (0 votes)
5 views14 pages

Android Viva Question

The document provides an overview of Android and Flutter, detailing their operating systems, development tools, and core components. It explains the Android SDK, programming languages used, and various components such as Activities, Services, and Intents, as well as data storage options and dialog boxes. Additionally, it covers Flutter's features, advantages, and the Dart programming language, including the concept of Stateful and Stateless widgets, and the importance of the pubspec.yaml file.

Uploaded by

ketan.bhoir2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views14 pages

Android Viva Question

The document provides an overview of Android and Flutter, detailing their operating systems, development tools, and core components. It explains the Android SDK, programming languages used, and various components such as Activities, Services, and Intents, as well as data storage options and dialog boxes. Additionally, it covers Flutter's features, advantages, and the Dart programming language, including the concept of Stateful and Stateless widgets, and the importance of the pubspec.yaml file.

Uploaded by

ketan.bhoir2002
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 14

Android Viva Question:

Q #1) What is Android?


Answer: Android is an open-source operating system and is mainly popular for
Smartphones and Tablets.
This operating system is Linux Kernel-based.

What is the Android SDK?


Answer: To develop a mobile application, Android developers require some
tools and this requirement is satisfied by “Android SDK” which is a set of tools
that are used for developing or writing apps.
Name the languages supported for Android development.
Answer: Java is the widely used language for Android development. It also
supports C/C++ and when used with Android SDK, it improves the performance
speed too.
Q #6) What are the advantages of the Android Operating System?
Answer: It is open-source and platform-independent. It supports various
technologies like Bluetooth, Wi-Fi, etc
Which components are necessary for a New Android project?
Answer: Whenever a new Android project is created, the below
components are required:
 manifest: It contains an XML file.
 build/: It contains build output.
 src/: It contains the code and resource files.
 res/: It contains bitmap images, UI Strings and XML Layout i.e. all non-
code resources.
 assets/: It contains a file that should be compiled into a .apk file.
Provide the important core components of Android.
Answer: The core components of Android operating systems are:
 Activity
 Intents
 Services
 Content Provider
 Fragment
Q #11) Explain briefly – what is meant by Activities?
Answer: Activities are the part of the mobile app which the user can see and
interact with.
For Example, if you open an SMS app which has multiple activities like create
new SMS, add a contact from the address book, write the content in the SMS
body, send SMS to the selected contact, etc.
Activity keeps a track of the following:
 Keeps track of what a user is currently looking for in an app.
 Keeps a track of previously used processes, so that the user can switch
between ongoing process and previous process.
 It helps to kill the processes so that the user can return to their previous
state
 What is meant by Services?
 Answer: Service is an Android component that runs in the background
and acts independently. It does not provide any user interface.
 Though the services are running behind the scene, a user can continue
their work on different apps. Most of the time, the users are not aware of
the services which are running in the background. These services allow
the system to kill the process without interrupting the user’s ongoing
work.
 A service is implemented as a subclass of Service class:
 Public class MainService extends Service
{
}
What is an Intent?
Answer: Android has an Intent class when the user has to navigate from one
activity to another. Intent displays notifications from the device to the user and
then the user can respond to the notification if required.
Given below are the two types:
 Implicit Intents
 Explicit Intents
Q #15) Explain Implicit and Explicit Intents.
Answer: Implicit Intent calls the system components while Explicit Intents
invoke the Activity class.
What is the database used for the Android platform?
Answer: SQLite is the database that is used for the Android platform. It is an
open-source, serverless database
Which are the dialog boxes supported by the Android platform?
Answer: Android supports four types of dialog boxes:
 AlertDialog: It has a maximum of 3 buttons and sometimes AlertDialog
includes checkboxes and Radio buttons to select the element.
 ProgressDialog: It displays the progress bar or wheels.
 TimePickerDialog: Using this dialog box, a user selects the Time.
 DatePickerDialog: Using this dialog box, a user selects the Date
Explain the AndroidManifest.xml file and why do you need this?
Answer: Every application must have an AndroidManifest.xml file in the root
directory. It contains information about your app and provides the same to the
Android system.
The information includes the package name, Android components such as
Activity, Services, Broadcast Receivers, Content Providers, etc. Every Android
system must have this information before running any app code.

AndroidManifest.xml file performs the following tasks:


 It provides a name to the Java package and this name is a unique
identifier for the application.
 It describes the various components of the application which include
Activity, Services, Content Providers, etc. Also, it defines the classes
which implement these components.
 It is responsible to protect the application and it declares the permission
for accessing the protected part of the app.
 It also declares the Android API which is going to be used by the
application.
 It contains the library file details which are used and linked to the
application.
What are the different data storage options available on the Android
platform?
Answer: Android platform provides a wide range of data storage options. These
options must be used based on the need such as data is secure and used with
permission only or can be accessed publicly.
Below is the list of data storage options on the Android platform:
 SharedPreference: It stores data in XML files. It is the simplest way to
store private data in the key-value pair.
 SQLite: It stores structured data in the private database.
 Internal Storage: It stores data in the device file system and any other
app cannot read this data.
 External Storage: Data is stored in the file system but it is accessible to
all apps in the device
 1) What is Flutter?
 Flutter is a UI toolkit for creating fast, beautiful, natively compiled
mobile applications with one programming language and a single
codebase. It is an open-source development framework developed by
Google. Generally, Flutter is not a language; it is an SDK. Flutter apps
use Dart programming language for creating an app. The first alpha
version of Flutter was released in May 2017.

What is Dart?

Dart is a general-purpose, object-oriented programming language with C-style


syntax. It is open-source and developed by Google in 2011. The purpose of Dart
programming is to create a frontend user interfaces for the web and mobile
apps. It is an important language for creating Flutter apps.

What are the Flutter widgets?

A Flutter app is always considered as a tree of widgets. Whenever you are going
to code for building anything in Flutter, it will be inside a widget. Widgets
describe how your app view should look like with their current configuration
and state. When you made any alteration in the code, the widget rebuilt its
description by calculating the difference of previous and current widget to
determine the minimal changes for rendering in the app's UI.

What do you understand by the Stateful and Stateless widgets?

A Stateful widget has state information. It is referred to as dynamic because it


can change the inner data during the widget lifetime. A widget that allows us to
refresh the screen is called a Stateful widget. This widget does not have a
build() method. It has createState() method, which returns a class that extends
the Flutters State Class. The examples of the Stateful widget are Checkbox,
Radio, Slider, InkWell, Form, and TextField.

The Stateless widget does not have any state information. It remains static
throughout its lifecycle. The examples of the Stateless widget are Text, Row,
Column, Container, etc. If the screen or widget contains static content, it should
be a Stateless widget, but if you want to change the content, it needs to be a
Stateful widget.

What is pubspec.yaml file?

It is the project's configuration file that will use a lot during working with the
Flutter project. It allows you how your application works. It also allows us to set
the constraints for the app. This file contains:

o Project general settings such as name, description, and version of the


project.
o Project dependencies.
o Project assets (e.g., images, audio, etc.).

What are the advantages of Flutter?

The popular advantages of the Flutter framework are as follows:

o Cross-platform Development: This feature allows Flutter to write the


code once, maintain, and can run on different platforms. It saves the time,
effort, and money of the developers.
o Faster Development: The performance of the Flutter application is fast.
Flutter compiles the application by using the arm C/C++ library that
makes it closer to machine code and gives the app a better native
performance.
o Good Community: Flutter has good community support where the
developers can ask the issues and get the result quickly.
o Live and Hot Reloading: It makes the app development process
extremely fast. This feature allows us to change or update the code are
reflected as soon as the alterations are made.
o Minimal code: Flutter app is developed by Dart programming language,
which uses JIT and AOT compilation to improve the overall start-up
time, functioning and accelerates the performance. JIT enhances the
development system and refreshes the UI without putting extra effort into
building a new one.
o UI Focused: It has an excellent user interface because it uses a design-
centric widget, high-development tools, advanced APIs, and many more
features.
o Documentation: Flutter has very good documentation support. It is
organized and more informative. We can get everything that we want to
be written in one place.

Explain Hot Reload in Flutter?

The hot reload feature allows you to quickly and easily perform an experiment
in the project. It helps to build UI, add new features, fix bugs, and make app
development fast. To perform hot reloading of a Flutter app, do the following
steps:

o Run the app in a supported Flutter editor or terminal window.


o Modify any of the Dart files in the project.
o If you use an IDE that supports Flutter, then select Save All or click the
Hot Reload button on the toolbar. Immediately, you can see the result in
your emulator or real device.

o Who developed the flutter framework?

o Flutter Framework is developed by Google.

o 5. What are the resources to learn Flutter?


o You can refer Flutter Documentation to learn flutter.

o What type of applications can you develop using Flutter?

o Flutter is an open-source UI toolkit by Google to develop android, iOS,


Linux, Mac and Web applications from a single codebase. Flutter is a
good choice for apps which needs to deliver high brand designs.

What is an Activity?

Answer: Activity performs actions on the screen. If you want to do any


operations, we can do with activity

What is an Intent?

Answer: It is connected to either the external world of application or internal


world of application, such as, opening a pdf is an intent and connect to the web
browser. etc.

What is viewGroup in android?

Answer: View group is a collection of views and other child views, it is an


invisible part and the base class for layouts.

What is a service in android?

Answer: The Service is like as an activity to do background functionalities


without UI interaction.

What is a content provider in android?


Answer: A content provider component supplies data from one application to
others on request. Such requests are handled by the methods of the
ContentResolver class. A content provider can use different ways to store its
data and the data can be stored in a database, in files, or even over a network.

What are the notifications available in android?

Answer: Toast Notification − It will show a pop up message on the surface of


the window Status Bar Notification − It will show notifications on status bar
Dialogue Notification − It is an activity related notification.

What is container in android?

Answer: The container holds objects, widgets, labels, fields, icons, buttons. etc.

What is an Adapter in android?

Answer: The Adapter is used to create child views to represent the parent view
items.

What is shared preferences in android?

Answer: Shared preferences are the simplest mechanism to store the data in
XML documents.

What are the key components in android architecture?

Answer: Linux Kernel Libraries Android Framework Android applications.


Where layouts are placed in android?

Answer: In The Layout folder, layouts are placed as XML files

How many dialog boxes do support in android?

Answer: AlertDialog, ProgressDialog, DatePickerDialog, and


TimePickerDialog

What do you mean by SQLiteOpenHelper class

It is a class found inside android.database.sqlite package. It is a helper class


that helps in creating the database, handling the operations and also the version
management. To use sqliteopenhelper, we will create a class, and then we will
extend SQLiteOpenHelper inside the class that we created.

Give small description about Sqlite

in android SQLite is a opensource SQL database that stores data to a text file
on a device. Android comes in with built in SQLite database implementation.
SQLite supports all the relational database features. In order to access this
database, you don't need to establish any kind of connections for it like
JDBC,ODBC e.t.c

What do you mean by cursor in SQLiteDatabase

The SQLiteDatabase always presents the results as a Cursor in a table format


that resembles that of a SQL database. You can think of the data as an array of
rows. A cursor is a pointer into one row of that structured data. The Cursor class
provides methods for moving the cursor through the data structure, and methods
to get the data from the fields in each row. The Cursor class has a number of
subclasses that implement cursors for specific types of data. SQLiteCursor
exposes results from a query on a SQLiteDatabase. SQLiteCursor is not
internally synchronized, so code using a SQLiteCursor from multiple threads
should perform its own synchronization when using the SQLiteCursor.

49) What is the importance of settings permission in app development? 


Permission allows certain restrictions to be imposed primarily to protect data
and code.  Without this, codes could be compromised, resulting in defects in
the actual function.

45) What are the different storage methods in android.

Android offers several different options for data persistence. a) Shared


Preferences:  Store private primitive data in key-value pairs. This sometimes
gets limited as it offers only key value pairs.  You cannot save your own java
types. b) Internal Storage:  Store private data on the device memory c)
External Storage:  Store public data on the shared external storage. d) SQLite
Databases:  Store structured data in a private database.  You can define
many number of tables and can store data like other RDBMS.

What are the features of RESTful Web Services?

Every RESTful web service has the following features:

 The service is based on the Client-Server model.


 The service uses HTTP Protocol for fetching data/resources, query execution, or any other
functions.
 The medium of communication between the client and server is called “Messaging”.
 Resources are accessible to the service by means of URIs.
 It follows the statelessness concept where the client request and response are not dependent
on others and thereby provides total assurance of getting the required data.
 These services also use the concept of caching to minimize the server calls for the same type
of repeated requests.
 These services can also use SOAP services as implementation protocol to REST architectural
pattern.
What are the features of RESTful web services?

REStful web services have the following unique features:

 Client-server decoupling

 Communication support

 Lightweight

 Uniform interface

 Stateless

 Layered system

 Cacheable

 Code on demand

What is Retrofit?
Retrofit is a REST client for Android, through which you can
1.
make easy to use interfaces which can turn any Android app
into a powerful one.
2. It is developed by Square Inc.
3. Retrofit turns your REST API into a Java interface.
4. Retrofit can perform Async and sync requests with
automatic JSON parsing without any effort.
What is Volley?
Volley is a networking library it offers great features like
1.
synchronous requests, asynchronous requests, prioritization,
making multiple requests at the same time, ordered
requests, and of course caching.
Difference Between Retrofit and Volley

Retrofit Volley
1. Retrofit can parse many 1. StringRequest – This type
other types of responses of request converts the
automatically like: response into a String.

Boolean – Web API response JsonObjectRequest – This


needs to be a boolean. type of request and response is
automatically converted into a
Integer – Web API response
needs to be an integer.

Date– Web API response should


be a Long format date.

String – Web API response


JSONObject.
needs to be in String format.
JsonArrayRequest – This type
Object – Web API response
of request and response is
needs to be in a JSON object.
automatically converted into a
Collections – Web API JSONArray.
response needs to be in a String
ImageRequest – This type of
Format.
request converts the response
Image Loading. into a decoded bitmap.

2. Caching: Android volley has


a flexible caching mechanism.
When a request is made
through volley first the cache is
checked for an appropriate
response if it is found there
2. Retrofit does not support than it is returned and parsed
caching. else network hit is made.

3. Retrying Mechanism: With


volley, we can set a retry policy
using the setRetryPolicy
3. Retrofit does not support method. It supports the
any retrying mechanism. But it customized request timeout,
can be achieved manually by number of retries, and backoff
doing some extra code. multiplier.

4. On the other 4.Post Requests and


hand, Retrofit has full support Multipart Uploads: Volley
for Post Requests and Multipart supports both posts requests
uploads. and multipart uploads but for
post requests, we have to
convert our java objects to
JSONObject.Also for multipart
uploads, we have to do some
extra code and use some
additional classes

4. What are the advantages and disadvantages of using Retrofit?

The main advantage of using Retrofit is that it makes it easy to connect to a


REST API and retrieve data. The main disadvantage is that it can be
difficult to set up, especially if you are not familiar with REST APIs.

5. What is the difference between a GET request and a POST request?

A GET request is a request for data from a server. A POST request is a


request to create or update data on a server

Differentiate Activities from Services.

Activities can be terminated or closed anytime the user wishes. On the other hand, services
are designed to run in the background, and they can act independently.

Most of the services run continuously, irrespective of whether there are certain or no
activities being executed.

Activities Services

They are designed to run in the These are mainly designed to run in the background. Foreground
foreground. services are also available.

Used when the user interface is


Used when the user interface is not necessary.
necessary.

They are dependent. They act independently.

What database is used in Android? How it is different from client-


server database management systems?

SQLite is the open-source relational database used in Android. The SQLite engine is
serverless, transactional, and also self-contained. Instead of the client-server relationship of
most database management systems, the SQLite engine is integrally linked with the
application.

You might also like