0% found this document useful (0 votes)
44 views4 pages

Lab Viva Questions

The document provides a comprehensive overview of key concepts and components in Android application development, including tools like Android Studio, Gradle, and SQLite. It covers essential elements such as Activities, Services, Intents, and various storage options, along with debugging techniques and performance optimization practices. Additionally, it discusses the use of Architecture Components like ViewModel and LiveData, as well as layout management with ConstraintLayout.

Uploaded by

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

Lab Viva Questions

The document provides a comprehensive overview of key concepts and components in Android application development, including tools like Android Studio, Gradle, and SQLite. It covers essential elements such as Activities, Services, Intents, and various storage options, along with debugging techniques and performance optimization practices. Additionally, it discusses the use of Architecture Components like ViewModel and LiveData, as well as layout management with ConstraintLayout.

Uploaded by

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

Mobile Application Development – Viva Questions for Lab

1. What is Android Studio?


Android Studio is the official Integrated Development Environment (IDE) for Google's
Android operating system, built on JetBrains' IntelliJ IDEA software and designed specifically
for Android development. It provides tools for building, testing, and debugging Android
applications.

2. What is an APK?
APK stands for Android Package Kit. It is the file format used by the Android operating
system for distribution and installation of mobile apps, middleware, and system files.

3. What is the use of Gradle in Android Studio?


Gradle is an advanced build toolkit used in Android Studio to automate and manage the
build process, including compiling the code, packaging the application, and managing
dependencies.

4. What are the four main components of an Android application?


The four main components are Activities, Services, Broadcast Receivers, and Content
Providers.

5. What is an Activity in Android?


An Activity is a single, focused thing that the user can do. It usually represents a single
screen with a user interface in an Android application.

6. What is a Service in Android?


A Service is a component that performs longrunning operations in the background without
providing a user interface. Examples include playing music, handling network transactions,
etc.

7. What is a Fragment in Android?


A Fragment represents a portion of the user interface in an Activity. It is used to build
dynamic and flexible UIs that can adapt to different screen sizes and orientations.

8. What is the difference between `findViewById` and `Data Binding`?


`findViewById` is used to locate views by their ID in the code, while Data Binding is a
more advanced feature that binds UI components in the XML layout to data sources in the
application using a declarative format.

9. What is an Intent in Android?


An Intent is a messaging object used to request an action from another app component.
Intents can be used to start an activity, service, or deliver a broadcast.

10. What is a Broadcast Receiver?


A Broadcast Receiver is a component that responds to broadcast messages from other
applications or from the system itself. These messages are sometimes called events or intents.
11. What are the different ways to store data in an Android application?
Data can be stored in Android using SharedPreferences, Internal Storage, External Storage,
SQLite Databases, and Content Providers.
12. What is SQLite in Android?
SQLite is a lightweight database used for local storage in Android applications. It supports
SQL syntax for database operations.

13. What is a Content Provider?


A Content Provider manages access to a central repository of data. It provides mechanisms
for defining data security and for managing the access permissions for data.

14. What is an AsyncTask in Android?


AsyncTask is an abstract class provided by Android that allows performing background
operations and publishing results on the UI thread without having to manipulate threads and
handlers.

15. What are LiveData and ViewModel in Android Architecture Components?


LiveData is an observable data holder class that respects the lifecycle of other app
components, such as activities and fragments. ViewModel is a class designed to store and
manage UIrelated data in a lifecycleconscious way.

16. How do you create a new project in Android Studio?


To create a new project in Android Studio, go to `File` > `New` > `New Project`, select a
project template, configure the project settings (such as name, package, and save location),
choose the language and minimum SDK version, and then click `Finish`.

17. How do you add a new Activity to an existing Android project?


To add a new Activity, rightclick on the `app` folder, select `New` > `Activity`, choose the
type of Activity you want to add, configure the Activity settings, and click `Finish`.

18. How do you handle click events for a Button in Android?


You can handle click events by setting an `OnClickListener` on the button either in XML
using the `android:onClick` attribute or programmatically in the Activity or Fragment using
`button.setOnClickListener()`.

19. What is Logcat in Android Studio?


Logcat is a commandline tool and window in Android Studio used to view log messages
generated by the Android system and apps. It is useful for debugging and tracking the behavior
of applications.

20. What are some common methods to debug an Android application?


Common debugging methods include using Logcat for logging, breakpoints for pausing
execution and inspecting variables, the debugger tool in Android Studio, and using the Android
Device Monitor.

21. What is the role of the AndroidManifest.xml file?


The `AndroidManifest.xml` file provides essential information about the application to the
Android system, such as the app's components (activities, services, broadcast receivers, content
providers), permissions, hardware and software features, and API level requirements.

22. What is ADB in Android development?


ADB stands for Android Debug Bridge. It is a versatile command-line tool that allows
developers to communicate with a device (emulator or physical device) for debugging,
installing, and running apps, accessing shell commands, and transferring files.

23. What is a PendingIntent in Android?


A `PendingIntent` is a token that you give to another application (such as the notification
manager, alarm manager, or other third-party apps), which allows the other application to
execute the specified code as if it were your application.

24. What is the difference between a Service and an IntentService?


A `Service` is a component that runs in the background to perform long-running operations
without a user interface, and it runs on the main thread. `IntentService` is a subclass of `Service`
that handles asynchronous requests (expressed as `Intents`) on demand, creating a worker
thread to handle each `Intent`.

25. What is the RecyclerView in Android?


`RecyclerView` is a more advanced and flexible version of `ListView`. It is designed to
efficiently display large sets of data by recycling views that are no longer visible to the user
and creating new ones as needed.

26. What are ViewGroups in Android?


`ViewGroups` are invisible containers that hold other `Views` (including other
`ViewGroups`). They define the layout structure and can manage the positioning and sizing of
their child views. Examples include `LinearLayout`, `RelativeLayout`, and `ConstraintLayout`.

27. What is an explicit intent?


An explicit intent is an `Intent` that specifies the exact component to start by using the
component's class name. It is typically used to start activities or services within the same
application.

28. What is an implicit intent?


An implicit intent does not name a specific component. Instead, it declares a general action
to perform, which allows any app that can handle the action to respond. The system matches
the intent against the intent filters of available components.

29. What is Room in Android?


`Room` is a part of the Android Architecture Components and is a persistence library that
provides an abstraction layer over SQLite to allow fluent database access while harnessing the
full power of SQLite. It includes features like compile-time verification of SQL queries and
convenient access methods.
30. What are SharedPreferences in Android?
`SharedPreferences` is a framework that allows you to save and retrieve persistent key-value
pairs of primitive data types. It is commonly used for storing user preferences, settings, and
other small amounts of data.

31. What is a Handler in Android?


A `Handler` is a utility class that allows you to send and process `Message` and `Runnable`
objects associated with a thread's `MessageQueue`. It is used to manage threads and handle
asynchronous operations within the main thread.
32. What is the purpose of WorkManager in Android?
`WorkManager` is an API that allows you to schedule and manage background tasks that
need guaranteed execution, even if the app is closed or the device restarts. It is designed to be
battery-friendly and works with various constraints like network connectivity and charging
status.

33. How do you implement navigation between activities in Android?


Navigation between activities is implemented using `Intents`. You create an `Intent` object,
specify the target activity class, and call `startActivity(intent)` to navigate to the new activity.

34. What is a ViewModel in Android Architecture Components?


A `ViewModel` is a class designed to store and manage UI-related data in a lifecycle-
conscious way. It is used to separate the UI data from UI controllers like activities and
fragments and helps in handling configuration changes.

35. What is the purpose of the Android Emulator?


The Android Emulator is a tool that allows developers to test and debug Android applications
on a virtual device instead of a physical device. It mimics the hardware and software features
of a typical Android device.

36. How can you handle configuration changes in Android?


Configuration changes, such as screen rotations, can be handled by overriding the
`onSaveInstanceState()` and `onRestoreInstanceState()` methods to save and restore the UI
state. Alternatively, you can use a `ViewModel` to retain data during configuration changes.

37. What are some common practices for improving the performance of an Android
application?
Common practices include minimizing the use of memory and CPU, optimizing layouts,
using efficient data structures, reducing the number of UI elements, avoiding memory leaks,
and using background threads for long-running operations.

38. What is ProGuard and how do you use it in Android?


ProGuard is a tool used to shrink, optimize, and obfuscate the code in an Android application.
It reduces the size of the APK and makes it harder to reverse-engineer the application. It can
be enabled in the `build.gradle` file by setting `minifyEnabled` to `true`.

39. What is the use of the `constraintLayout` in Android?


`ConstraintLayout` is a layout manager used to create complex and responsive UI designs
without nesting multiple `ViewGroup` elements. It allows positioning and sizing widgets based
on constraints to other widgets and the parent layout.

40. How do you handle different screen sizes and densities in Android?
Different screen sizes and densities are handled by providing multiple layout and resource files
optimized for different screen configurations. These are placed in specific resource directories
(e.g., `res/layout-sw600dp`, `res/drawable-hdpi`) and Android automatically selects the
appropriate resources based on the device's screen characteristics.

You might also like