Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 5 MCQs Smart Device Communication and Sensing Systems

CSE227 — Advanced Android App Development 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Bluetooth overview Easy

    What is the primary purpose of Bluetooth technology in mobile devices?

  2. Question 2 of 60 Bluetooth overview Easy

    In the context of Bluetooth, what does 'BLE' stand for?

  3. Question 3 of 60 Perform network operations Easy

    Which permission must you declare in the AndroidManifest.xml file to allow an application to create network sockets and access the internet?

  4. Question 4 of 60 Perform network operations Easy

    Why is it important to perform network operations on a background thread instead of the main (UI) thread in Android?

  5. Question 5 of 60 Available Devices Easy

    What is the process of searching for nearby Bluetooth devices that are broadcasting their presence called?

  6. Question 6 of 60 Available Devices Easy

    Which method in the BluetoothAdapter class starts the process of searching for nearby Bluetooth devices?

  7. Question 7 of 60 Paired Devices Easy

    What is a 'paired' or 'bonded' Bluetooth device?

  8. Question 8 of 60 Paired Devices Easy

    Which Android method returns a set of BluetoothDevice objects representing the devices that are already paired with the local device?

  9. Question 9 of 60 Wi-Fi Companion device pairing overview Easy

    What is a major advantage of using Wi-Fi for companion device pairing over Bluetooth Classic?

  10. Question 10 of 60 Wi-Fi Companion device pairing overview Easy

    What is the purpose of the CompanionDeviceManager API in Android?

  11. Question 11 of 60 Connect devices Easy

    In Bluetooth communication, what is a BluetoothSocket primarily used for?

  12. Question 12 of 60 Connect devices Easy

    Which communication protocol is commonly used in Android to create a reliable, stream-based connection over Bluetooth, similar to TCP?

  13. Question 13 of 60 Motion sensors Easy

    Which type of sensor measures the acceleration forces acting on a device, including the force of gravity?

  14. Question 14 of 60 Motion sensors Easy

    What does a gyroscope sensor measure?

  15. Question 15 of 60 Motion sensors Easy

    To implement a feature that detects when a user 'shakes' their phone, which sensor would be most suitable to use?

  16. Question 16 of 60 Position sensors Easy

    Which sensor helps a device determine its orientation relative to the Earth's magnetic north, acting like a digital compass?

  17. Question 17 of 60 Position sensors Easy

    What is the most common use case for a proximity sensor in a smartphone?

  18. Question 18 of 60 Environment sensors Easy

    Which sensor would you use to measure the ambient air pressure?

  19. Question 19 of 60 Environment sensors Easy

    A photometer, also known as a light sensor, is used to measure what?

  20. Question 20 of 60 Environment sensors Easy

    Which category of sensors do the thermometer, barometer, and hygrometer belong to?

  21. Question 21 of 60 Bluetooth overview Medium

    An Android app needs to connect to a heart rate monitor to stream data continuously. Which Bluetooth profile is most suitable for this use case, prioritizing low power consumption?

  22. Question 22 of 60 Bluetooth overview Medium

    In a Bluetooth Classic connection between a smartphone (master) and a speaker (slave), which device is responsible for initiating the connection and managing the piconet timing?

  23. Question 23 of 60 Perform network operations Medium

    When establishing a Bluetooth connection using BluetoothSocket, which method call is blocking and should not be executed on the main UI thread to avoid an Application Not Responding (ANR) error?

  24. Question 24 of 60 Perform network operations Medium

    Your app is designed to receive a stream of sensor data from a connected Bluetooth device. Which component is essential for handling incoming data asynchronously from the BluetoothSocket's InputStream in a separate thread?

  25. Question 25 of 60 Perform network operations Medium

    To create a secure server-side BluetoothServerSocket for an app that needs to accept incoming connections, what is the correct method to call on the BluetoothAdapter?

  26. Question 26 of 60 Available Devices Medium

    To discover new Bluetooth LE devices, your app starts a scan using BluetoothLeScanner.startScan(). To ensure the scan doesn't drain the battery, what is the recommended practice?

  27. Question 27 of 60 Available Devices Medium

    An app needs to find nearby smartwatches that advertise a specific service UUID. How can you configure the Bluetooth LE scan to only return devices that match this criterion, thus saving power and processing time?

  28. Question 28 of 60 Paired Devices Medium

    How does an Android app retrieve a list of Bluetooth devices that have already been paired with the phone without initiating a new discovery scan?

  29. Question 29 of 60 Paired Devices Medium

    When a user pairs a new Bluetooth device through the system settings while your app is running, which broadcast intent action should your app listen for to update its list of paired devices dynamically?

  30. Question 30 of 60 Wi-Fi Companion device pairing overview Medium

    What is the primary advantage of using the Companion Device Manager (CDM) for pairing with a Wi-Fi device over a traditional Wi-Fi Direct or Soft AP approach?

  31. Question 31 of 60 Wi-Fi Companion device pairing overview Medium

    To initiate companion device pairing, an app needs to create an AssociationRequest. Which piece of information is crucial to include in this request to filter the type of device the user can select from the system-provided dialog?

  32. Question 32 of 60 Connect devices Medium

    An app is using the Network Connectivity API to connect to a smart home device via Wi-Fi. It needs to maintain this connection even if the Wi-Fi network has no internet access. Which capability should be removed from the NetworkRequest.Builder?

  33. Question 33 of 60 Connect devices Medium

    Your app uses Wi-Fi Aware to discover and connect to a nearby device. After a successful discovery, what is the next step to establish a direct, bi-directional data path between the two devices?

  34. Question 34 of 60 Motion sensors Medium

    An app needs to detect the device's orientation in 3D space, including its heading (azimuth) relative to magnetic north. Which sensor or sensor combination provides the most direct and stable data for this purpose?

  35. Question 35 of 60 Motion sensors Medium

    To implement a "shake to undo" feature, you need to detect a sudden, sharp movement of the device. Which approach using the accelerometer data (SensorEvent.values) would be most effective?

  36. Question 36 of 60 Motion sensors Medium

    You are building a game where the user tilts the device left and right to control a character. You notice the controls are jittery. To smooth the input from the accelerometer, what signal processing technique should you apply to the sensor readings?

  37. Question 37 of 60 Position sensors Medium

    An application requires the device's orientation relative to the Earth's magnetic field to build a compass. Which sensor type should be registered with the SensorManager to get the raw geomagnetic field data?

  38. Question 38 of 60 Position sensors Medium

    To determine the device's absolute orientation (including North, East, Up), you need to combine data from two specific sensors. Which pair is used by SensorManager.getRotationMatrix() for this calculation?

  39. Question 39 of 60 Environment sensors Medium

    You are developing a hiking app that estimates the user's current altitude. Which sensor provides the most direct and energy-efficient data for calculating changes in altitude?

  40. Question 40 of 60 Environment sensors Medium

    An app adjusts its UI theme (e.g., light or dark mode) based on the brightness of the user's surroundings. Which sensor should it listen to for this functionality?

  41. Question 41 of 60 Bluetooth overview Hard

    You are designing a BLE peripheral that streams sensor data. The data packets are small (18 bytes) and must be delivered with the lowest possible latency. To minimize power consumption while meeting the latency requirement, which combination of BLE connection parameters should you request from the central device?

  42. Question 42 of 60 Perform network operations Hard

    An Android app communicates with a BLE device that has a custom GATT service. To send a firmware update file (100KB), the app must write data to a characteristic. The MTU size has been negotiated to 247 bytes, allowing a payload of 244 bytes per write. The characteristic uses WRITE_TYPE_DEFAULT (Write With Response). What is the most significant performance bottleneck you must design around?

  43. Question 43 of 60 Motion sensors Hard

    You are developing an indoor navigation app that uses sensor fusion. You are using TYPE_ROTATION_VECTOR to get the device's orientation. However, you notice a slow, persistent drift in the heading (yaw/azimuth) over several minutes, even when the device is stationary. What is the most likely cause and the best way to correct it?

  44. Question 44 of 60 Available Devices Hard

    You are using BluetoothLeScanner.startScan() with a ScanFilter to find a specific peripheral that advertises a custom service UUID. The app works on Android 11 but fails to discover any devices on Android 12, even though all runtime permissions (BLUETOOTH_SCAN, BLUETOOTH_CONNECT, ACCESS_FINE_LOCATION) are granted. The device is advertising correctly. What is a likely cause of this issue?

  45. Question 45 of 60 Wi-Fi Companion device pairing overview Hard

    You're using the CompanionDeviceManager API to allow a user to configure a new headless IoT device (like a smart speaker) by connecting the phone to the device's soft AP. Which of the following statements most accurately describes a critical limitation or requirement of this process?

  46. Question 46 of 60 Position sensors Hard

    You are creating an augmented reality app that overlays information on the real world. You need the most stable and accurate orientation possible, but it must be immune to magnetic disturbances from nearby electronics or metal structures. Which sensor type is the most appropriate choice and why?

  47. Question 47 of 60 Environment sensors Hard

    You are using the phone's barometer (TYPE_PRESSURE) to measure small changes in altitude, such as moving between floors in a building. The raw pressure reading is (in hPa or mbar) and the sea-level reference pressure is . The formula for altitude is . What is the most significant source of error you must account for in your algorithm to achieve reliable floor detection?

  48. Question 48 of 60 Paired Devices Hard

    Your app needs to maintain a connection to a bonded BLE medical device. The connection must be re-established automatically and quickly if the user walks out of range and then returns. You are handling reconnection logic in a background service. Which strategy is most robust and battery-efficient for re-establishing the connection?

  49. Question 49 of 60 Connect devices Hard

    In your BluetoothGattCallback, you need to enable notifications for two different characteristics (charA and charB) immediately after connecting. Your code calls gatt.writeDescriptor() for charA's CCCD, and inside the onDescriptorWrite callback for that operation, it calls gatt.writeDescriptor() for charB's CCCD. Why is this sequential approach mandatory?

  50. Question 50 of 60 Motion sensors Hard

    You're implementing a pedometer using TYPE_STEP_COUNTER. The app is killed by the system while in the background. When the user re-opens the app hours later, how do you correctly calculate the number of steps taken during the time the app was not running?

  51. Question 51 of 60 Perform network operations Hard

    You are building a chat application over Bluetooth Classic using RFCOMM sockets (BluetoothSocket). The app experiences random crashes with IOException: Broken pipe when sending data. The connection seems stable otherwise. The code that sends data is called from multiple UI threads. What is the most likely cause of this error?

  52. Question 52 of 60 Bluetooth overview Hard

    In a GATT server implementation on an Android peripheral, you define a characteristic with properties PROPERTY_READ and PROPERTY_NOTIFY. You also add a Client Characteristic Configuration Descriptor (CCCD). A central device connects and writes to the CCCD to enable notifications. Later, the central disconnects and reconnects. What is the state of notifications for this central device upon reconnection?

  53. Question 53 of 60 Connect devices Hard

    You are developing an app that connects to a Wi-Fi network programmatically using ConnectivityManager.requestNetwork(). The network has no internet access (it's for an IoT device). After a successful connection, you observe that the Android OS disconnects from this network after about a minute and reconnects to the user's home Wi-Fi. How do you prevent this behavior and maintain the connection to the no-internet Wi-Fi?

  54. Question 54 of 60 Available Devices Hard

    Your app uses BLE scanning with ScanSettings.Builder().setScanMode(ScanSettings.SCAN_MODE_LOW_LATENCY). On some newer Android devices, you notice the app's UI becomes sluggish and sometimes unresponsive during the scan. What is the most likely technical reason for this performance degradation?

  55. Question 55 of 60 Wi-Fi Companion device pairing overview Hard

    When using CompanionDeviceManager.associate(), what is the primary advantage of using an AssociationRequest with a BluetoothLeDeviceFilter over using the classic BluetoothAdapter.startLeScan() API for pairing with a BLE device?

  56. Question 56 of 60 Paired Devices Hard

    An app connects to a bonded BLE device. The device undergoes a firmware update which changes its GATT service structure (e.g., adds new characteristics). After the update, the app running on Android can no longer discover the new services or characteristics, even after reconnecting. What is the most probable cause and the correct solution?

  57. Question 57 of 60 Position sensors Hard

    You are trying to obtain the most accurate bearing for outdoor navigation. You get orientation data from SensorManager.getOrientation() which returns azimuth, pitch, and roll. However, the azimuth (bearing) is relative to magnetic North. To get the bearing relative to true North, what additional information do you need and how do you apply it?

  58. Question 58 of 60 Environment sensors Hard

    Your app uses TYPE_LIGHT sensor to adjust screen brightness. You observe that in a consistently lit room, the sensor values fluctuate significantly (e.g., between 200 and 250 lux). To create a stable brightness setting, you decide to implement a filter. Which filtering approach is most suitable for this use case?

  59. Question 59 of 60 Perform network operations Hard

    You have a BluetoothGatt connection to a peripheral. All GATT operations are initiated from a background thread to avoid blocking the UI. The BluetoothGattCallback methods, however, are invoked on a system binder thread. What is a critical threading consideration you must implement in your callback handler?

  60. Question 60 of 60 Motion sensors Hard

    You are tasked with detecting a specific, complex gesture, like drawing a figure '8' in the air. Simply using TYPE_LINEAR_ACCELERATION is insufficient as it ignores rotation. Which approach would be most effective for recognizing this gesture?

That's unit 5

Answer a few questions and your score shows up here.