Android Development Quiz

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

Which of the following is NOT a type of persistent storage available in Android applications?

  • Shared Preferences
  • Internal Files
  • SQLite databases
  • Cookies (correct)

Shared Preferences in Android can store non-primitive data types.

False (B)

What is the purpose of the AssetManager in Android applications?

To provide access to an application's raw asset files.

The __________ directory in Android is used for storing compiled XML files.

<p>res/xml</p> Signup and view all the answers

Match the following persistent storage types with their descriptions:

<p>Shared Preferences = Persistent storage for key-value pairs SQLite databases = Structured data storage using SQL Internal storage = Private storage space for application External storage = Public storage accessible by other apps</p> Signup and view all the answers

Which method is used to bind an adapter to a ListView?

<p>setAdapter() (D)</p> Signup and view all the answers

The BaseAdapter class does not require the implementation of the getCount() method.

<p>False (B)</p> Signup and view all the answers

What is the purpose of the ViewHolder pattern in an adapter?

<p>To optimize item view recycling and improve performance.</p> Signup and view all the answers

To display a list in Android, the class used is called __________.

<p>ListView</p> Signup and view all the answers

What data structure is used to store key-value pairs in a SimpleAdapter?

<p>HashMap (A)</p> Signup and view all the answers

Match the following classes or interfaces with their correct purpose:

<p>ArrayAdapter = Bind an array to a list view SimpleAdapter = Bind a list of maps to a list view BaseAdapter = Custom adapter for complex lists AdapterView.OnItemClickListener = Handles item click events</p> Signup and view all the answers

Parcelable is more complex than Serializable in Java.

<p>True (A)</p> Signup and view all the answers

What method would you use to retrieve the selected item in a Spinner?

<p>getSelectedItem()</p> Signup and view all the answers

To show a toast message in Android, you use __________.makeText().

<p>Toast</p> Signup and view all the answers

What attribute is used to align a component to the top of its parent in a RelativeLayout?

<p>android:layout_alignParentTop (A)</p> Signup and view all the answers

The android:layout_rowSpan attribute is used to spread a component across multiple columns in a GridLayout.

<p>False (B)</p> Signup and view all the answers

How do you specify that a view in a GridLayout should start at the first column?

<p>android:layout_column=&quot;0&quot;</p> Signup and view all the answers

In a RelativeLayout, to align one view relative to another, you would use _______ attributes.

<p>id-based</p> Signup and view all the answers

Match the following layout features with their descriptions:

<p>android:layout_centerHorizontal = Aligns view centrally along the horizontal axis android:layout_columnSpan = Spreads a component across multiple columns android:layout_toRightOf = Positions a component to the right of another component android:layout_alignParentBottom = Aligns the view to the bottom of its parent</p> Signup and view all the answers

Which of these attributes would you use to center a component in its parent layout?

<p>android:layout_centerInParent (B)</p> Signup and view all the answers

What is the primary purpose of using Include, Merge, and ViewStub in layouts?

<p>To simplify layout management and improve performance.</p> Signup and view all the answers

Which method is executed first in the AsyncTask lifecycle?

<p>onPreExecute() (A)</p> Signup and view all the answers

The doInBackground() method runs synchronously and blocks the UI thread until completion.

<p>False (B)</p> Signup and view all the answers

What type of values does the AsyncTask class accept for its execute() method?

<p>Object type values</p> Signup and view all the answers

The method that provides a way to update the UI with progress from doInBackground is called __________.

<p>onProgressUpdate</p> Signup and view all the answers

Match the following AsyncTask methods with their descriptions:

<p>onPreExecute() = Initial setup before background execution doInBackground() = Heavy resource processing onProgressUpdate() = Updates progress of background execution onPostExecute() = Final result processing after background completion</p> Signup and view all the answers

What does the publishProgress() method do in the AsyncTask class?

<p>Updates the progress UI during doInBackground() execution. (C)</p> Signup and view all the answers

The onPostExecute() method accepts parameters of a primitive type.

<p>False (B)</p> Signup and view all the answers

What is the return type of the doInBackground() method in this context?

<p>Bitmap</p> Signup and view all the answers

The AsyncTask class runs work on a __________ thread, separate from the UI thread.

<p>secondary</p> Signup and view all the answers

In the HeavyTask class, which method is called to perform background processing?

<p>doInBackground() (B)</p> Signup and view all the answers

What method is used to obtain a string from a JSONObject?

<p>getString() (B)</p> Signup and view all the answers

JSONArray does not allow accessing its elements by index.

<p>False (B)</p> Signup and view all the answers

What is the purpose of POJO in Java?

<p>To create models for JSON or XML objects.</p> Signup and view all the answers

Retrofit uses _____ by default for JSON conversion.

<p>Gson</p> Signup and view all the answers

Match the following methods with their functions:

<p>getInt() = Retrieve an integer from a JSONObject length() = Get the number of elements in a JSONArray getJSONObject() = Extract a nested JSONObject from a JSONObject setEndpoint() = Define the base URL for a RestAdapter</p> Signup and view all the answers

Which HTTP method is used to request data in Retrofit?

<p>GET (B)</p> Signup and view all the answers

RestAdapter must be built before creating a RestInterface instance.

<p>True (A)</p> Signup and view all the answers

What is the primary role of the Retrofit Interface?

<p>To manage URL connections and API calls.</p> Signup and view all the answers

The library that provides a set of tools for managing the URL's is called _____ class.

<p>service</p> Signup and view all the answers

Which of the following is not mentioned as a resource for Android development?

<p>Professional Java Development (C)</p> Signup and view all the answers

Flashcards

RelativeLayout

A layout where views are positioned relative to each other and the parent container, using attributes like android:layout_alignParentTop and android:layout_alignLeft.

Align to Parent Top

The attribute android:layout_alignParentTop aligns a view to the top edge of its parent container within a RelativeLayout.

Align to Other Components

You can position views relative to other views within a RelativeLayout, such as android:layout_alignLeft="@id/viewName" to align the left edge to the left edge of another view.

Position Below/Above

In a RelativeLayout, you can place a view below or above another view by using android:layout_below="@id/viewName" or android:layout_above="@id/viewName".

Signup and view all the flashcards

Position to Right/Left Of

Similar to android:layout_below or android:layout_above, the attribute android:layout_toRightOf positions a view to the right of another view within a RelativeLayout.

Signup and view all the flashcards

GridLayout

A layout that organizes views in a grid structure, allowing control over column and row spans.

Signup and view all the flashcards

GridLayout Row Span

The android:layout_rowSpan attribute can expand a GridLayout view across multiple rows, similar to merging cells in a spreadsheet, increasing the view’s vertical presence.

Signup and view all the flashcards

ListView

A fundamental control used for displaying lists of data in Android, providing flexibility and interactive capabilities.

Signup and view all the flashcards

ArrayList

A data structure that holds a collection of elements in order, with each element uniquely identified by its position.

Signup and view all the flashcards

ArrayAdapter

An adapter that connects a ListView to a data source. It converts data from the source into views for displaying on the ListView.

Signup and view all the flashcards

SimpleAdapter

A specialized adapter designed for displaying data in a tabular format with multiple columns in a ListView.

Signup and view all the flashcards

BaseAdapter

A powerful adapter that provides full control over the layout and content of ListView items, allowing for custom view structures.

Signup and view all the flashcards

OnItemClickListener

An event triggered when a user selects an item from a ListView.

Signup and view all the flashcards

onItemClick

A method that handles the selection of an item from a ListView.

Signup and view all the flashcards

Object Serialization

A mechanism for saving and retrieving data from memory or storage, using a process of converting objects into a serialized format.

Signup and view all the flashcards

Serializable

A Java interface for enabling object serialization, making objects persistable and transferable.

Signup and view all the flashcards

What is AsyncTask?

An abstract class that allows for performing long-running tasks in a background thread, ensuring that the UI thread remains responsive.

Signup and view all the flashcards

What does the onPreExecute() method do?

The first method called in the AsyncTask lifecycle, executed on the UI thread before the background processing begins.

Signup and view all the flashcards

What is the purpose of the doInBackground() method?

This method performs the long-running, computationally intensive task in a background thread, ensuring the UI remains responsive.

Signup and view all the flashcards

What is the purpose of the onProgressUpdate() method?

Used to report progress updates from the doInBackground() method in a background thread and update the UI with progress information.

Signup and view all the flashcards

What is the role of the onPostExecute() method?

This method is executed on the UI thread once the doInBackground() method finishes its task, receiving the result of the background processing.

Signup and view all the flashcards

What is the purpose of the publishProgress() method?

Called within the doInBackground() method to notify the UI about changes in progress. It directly calls the onProgressUpdate() method, triggering UI updates.

Signup and view all the flashcards

How do you start an AsyncTask?

The execute(params) method initiates the AsyncTask operation, passing the necessary parameters to the doInBackground() method.

Signup and view all the flashcards

What data types can be passed to an AsyncTask?

AsyncTask doesn't accept primitives like int or double as parameters. They need to be wrapped as objects, such as Integer or Double.

Signup and view all the flashcards

What is a common use of the onPreExecute() method?

Initialize objects that might be needed to display progress information. This method is typically used for UI initialization and any initial setup before background processing begins.

Signup and view all the flashcards

What kind of work should be done in the doInBackground() method?

The doInBackground() method should be used for intensive processing that may take a significant amount of time. It ensures UI responsiveness by performing these tasks in a separate thread.

Signup and view all the flashcards

Application container: res/raw

A directory within the application container where raw files can be stored. These files can be accessed as resources, making it possible to handle various data types like images, audio, text, and more.

Signup and view all the flashcards

Application container: Assets directory

A special directory within the application container that offers a way to organize and manage data through file processing and handling. It is used for grouping files and subdirectories, but does not necessarily handle files within the application resources.

Signup and view all the flashcards

Application container: AssetManager

A method for accessing an application's raw asset files directly, enabling seamless access using getAssets() from the Context class. This allows retrieval of files, listing files within specified paths, and even grabbing a parser for compiled XML files.

Signup and view all the flashcards

Application container: App's private storage area

A private space dedicated to the app within the device's storage, with subdirectories dedicated to different data types, ensuring a secure and organized way to store persistent information.

Signup and view all the flashcards

Application container: App's private external storage area

A specific area within the device's external storage reserved for the app, where data is saved and managed. It's like an extension of the app's private storage area.

Signup and view all the flashcards

JSON

A standard format for representing data in a structured way, often used for exchanging data between applications and systems.

Signup and view all the flashcards

JSONObject

A Java class used to represent a JSON object, allowing you to access and manipulate its properties.

Signup and view all the flashcards

JSONArray

A Java class used to represent a JSON array, providing methods for accessing and iterating through its elements.

Signup and view all the flashcards

POJO

Plain Old Java Object. A simple Java class that represents a data structure, often used to map JSON data.

Signup and view all the flashcards

Retrofit

A popular Java library for making RESTful API calls, simplifying communication with web services.

Signup and view all the flashcards

RestAdapter

A class in Retrofit responsible for building and customizing the client for communicating with REST APIs.

Signup and view all the flashcards

Retrofit Interface

A Java interface that defines the methods and endpoints for interacting with the REST API.

Signup and view all the flashcards

Gson

A Java library that provides a simple-to-use mechanism for converting Java objects to JSON and vice versa.

Signup and view all the flashcards

JSON Schema to POJO Converter

A tool used to convert JSON schema or XML schema into Java POJO classes.

Signup and view all the flashcards

Retrofit Method

A method call in Retrofit that specifies the type of HTTP request, the URL endpoint, and parameters for the API call.

Signup and view all the flashcards

Study Notes

Mobile Devices and Applications

  • This unit covers Android basics, including objectives, evaluation criteria, and a learning path.

Unit 1 - Android Basics

  • Objectives:

    • Efficiently use mobile technologies within the information society.
    • Understand mobile device principles.
    • Achieve Android development skills.
  • Evaluation:

    • Course activity: 50% (final quiz exam - 50%, lab activity - 50%, 2 partial evaluations - 30%, ongoing evaluation - 20%)
    • Final evaluation: January ???, 2023
    • Minimum laboratory attendance: 70%
    • Minimum 2.5/5 points for attending the final exam
    • Pass all evaluation activities with a minimum of 50% from the total points.
  • Agenda:

    • Mobile devices
    • Android framework
    • Development instruments
    • Android application structure
  • Learning path:

    • Mobile devices (architecture, characteristics, limitations)
    • Mobile OS (functions, user interfaces, applications)
    • Mobile apps (life cycle, resources, components)
    • Android development skills.

Mobile devices

  • Characteristics and Functionality:

    • Social networking (managing personal content like contacts, agenda, calendar)
    • Internet browsing
    • Entertainment & multimedia (games, virtual books, movies, images, music)
    • Communication (e-mails, messages, voice services)
    • Navigation (GPS, localization)
    • Financial transactions
    • Portability
    • Usability
    • Performance (autonomy - battery life)
    • Memory (RAM and ROM)
    • Bandwidth
    • User Experience
    • Form factor
  • Limitations:

    • Dimensions (screen, keyboard)
    • Autonomy (battery life)
    • Performance
    • Memory (RAM and ROM)
    • Bandwidth
    • User Experience
    • Form factor
    • Trends (prices, hardware/software performance, usability)
  • Hardware characteristics:

    • Processor
    • Memory
    • Screen
    • Data gathering
    • Connectivity
    • System on a Chip (SoC) components (Flash memory, RAM, Power supply, Communication Processor, CPU, GPU, Audio, I/O devices, SIM, Screen)
  • SoC characteristics/components:

    • Application processor (CPU)
    • Memory interface
    • Graphic processor (GPU)
    • USB controller
    • Serial interface
    • Bluetooth controller
    • Wi-Fi controller
    • Camera interface
    • Architecture (RISC)
    • Processors (ARM, Intel)
    • Working frequencies (around 2.7 GHz)
    • Core count (one, dual, quad, octa-core)
    • Low power consumption
  • SoC examples:

    • Marvell: PXA
    • Texas Instruments: OMAP
    • Samsung: S3C, S5C, S5P
    • Qualcomm: MSM, QSD
    • nVidia: Tegra
    • Snapdragon 400 - 800 - 765G with Kryo 475(current Google Pixel 5 specs) (2.45 GHz)
    • Exynos 5, 7, 2200
    • Tegra 4, K1
  • Specific components (Memory): RAM (up to 6GB)

    • Internal non-volatile memory (Flash, NOR, NAND)
    • External memory (SD cards)
    • NAND Flash Specs (comparing SLC, EMLC, MLC, TLC based on bits per cell, power, speed, and endurance)
  • Screen Characteristics:

    • Diagonal (~87.6 cm²)
    • Resolution (1080 x 2340 pixels)
    • Pixel density (~432 ppi)
    • Number of colors (16M colors)
    • Technology (LCD TFT, LCD IPS, OLED, AMOLED)
    • Touchscreen type (resistive, capacitive)
    • Data input solutions such as virtual / numeric keyboards, Joysticks, QWERTY keyboards, swiping, vocal commands, fingerprint, face recognition
    • Connectivity such as voice services, data connection, area coverage, Small – NFC/Bluetooth, Extended – Wi-Fi a/ b/g/n/ac
    • Bandwidth and technologies for wireless networks such as WPAN (9.6 Kbps–3 Mbps), WLAN( 1–300 Mbps), WWAN (8 Kbps-300 Mbps) and related technologies (IR, Bluetooth, NFC, GSM, EDGE, UMTS, etc.)
  • Mobile Operating Systems:

    • Architecture and main functions
    • Manage hardware and software resources
    • Manage memory
    • Control processes
    • Check I/O gates
    • Run applications
    • File management
    • Check the user interface
    • E-mail/Web messages
    • PIM
    • Other applications
    • User interface
    • Basic functions/Services
    • Kernel
    • Drivers
    • Hardware -Telephony
    • Android(Google), Bada(Samsung), Tizen(Tizen Association), Blackberry OS(Blackberry/RIM),BREW(Qualcomm),Firefox OS(Mozilla),iOS(Apple),Linux Mobile, Palm OS/Garnet OS(Palm),Symbian(Nokia),webOS(HP),Windows Phone/Windows CE/Windows Mobile(Microsoft)
  • Market share (Italy - August 2020):

    • Android: ~75%
    • iOS: ~25%
      • Other operating systems less than 1%
  • Android:

    • Bought by Google in 2005
    • Open Handset Alliance in 2007
    • Powered by Linux 2.6.x/3.x kernel
    • Java/Kotlin based applications
    • Phones(HTc, Samsung, Google Nexus)
    • Tablets(Samsung Galaxy Tab, Google Nexus 7)
    • Free/open source software ecosystem (Sailfish OS, Tizen, Ubuntu Touch OS, OpenMoko Linux, etc.)
    • Android System Stack(Applications, Android Framework, Native Libraries, HAL, and Linux Kernel)
    • Android architecture components(Applications, Application Framework, Libraries, Hardware, Abstraction Layer, Linux Kernel)
      • Media server
      • System server
      • HAL
      • Android runtime
    • Dalvik Virtual Machine - bytecode optimized file system
  • APK Signature Structure (describing the APK format steps)

  • Android Binary Files (describing the different types of files inside an APK structure such as .java, .class, .dex)

  • Components (describing the structure of an app in sections such as sources ,res, build properties and gen.)

  • UI components: List of UI controls, such as Textview, Edittext, Button, Radiobutton , Checkbox,ImageView, ProgressBar,SeekBar, AnalogClock, etc.

  • Event handling - using listeners, xml, and java code. Steps involved in registering listeners like (View.OnclickListener) , (View.OnTouchListener), (View.OnLongClickListener) in an interface, xml file.

  • XML layout component - creating layout files with properties for elements using XML.

  • Common properties including properties for dimensions, appearance, spacing, active state , focus, container parameters, position.

  • Layout containers such as LinearLayout, Relative layout, FrameLayout, and GridLayout

  • Different file types (XML) - specifying the path for layout files, and res/values folder.

  • Screen sizes, densities: Methods and code examples for conversions 1px = 1.5dp

  • Android UI Controls and their use: Common Android UI components (TextView, EditText, Button, ImageView, ProgressBar, etc.) and how to integrate them into an interface

  • Android Support Library - a set of components and classes for managing the application in a structured way

  • Android Virtual Device (AVD): An emulator that simulates Android devices. Emulators are used for creating testing environments. Includes functionality to simulate different processors, screen sizes, cameras, memory and API version, as well as the communication with the device via the ADB.

  • Android Profiler: For monitoring and analyzing app performance, memory, network interactions, and other essential data sources

  • Message console (Logcat): Shows the logs sent by applications while running including warnings, debug information, errors, or info messages in verbose mode

  • Device File Explorer: Tools to manage and explore files on the connected device

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Activities and Intents in Android Development
12 questions
Développement d'applications Android
5 questions
Mobile Applications Development 1: Android Overview
10 questions
Broadcast Receivers in Android Development
30 questions
Use Quizgecko on...
Browser
Browser