Android Development Quiz
41 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

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

    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()</p> Signup and view all the answers

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

    <p>False</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</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</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</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</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</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()</p> Signup and view all the answers

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

    <p>False</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.</p> Signup and view all the answers

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

    <p>False</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()</p> Signup and view all the answers

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

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

    JSONArray does not allow accessing its elements by index.

    <p>False</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</p> Signup and view all the answers

    RestAdapter must be built before creating a RestInterface instance.

    <p>True</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</p> Signup and view all the answers

    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

    Description

    Test your knowledge on Android persistent storage, adapters, and UI components in this informative quiz. Covering topics such as Shared Preferences, AssetManager, and the ViewHolder pattern, you'll reinforce your understanding of essential Android concepts. Perfect for both beginners and experienced developers!

    More Like This

    Use Quizgecko on...
    Browser
    Browser