MCQs / Computer Science / Course Project: Build a Modern Cloud App Step by Step

Course Project: Build a Modern Cloud App Step by Step MCQs — Computer Science (page 2)

52 multiple-choice questions on Course Project: Build a Modern Cloud App Step by Step from Computer Science, each with the correct answer and, where available, a teacher's explanation. Read through them to revise the chapter, then practise the same questions one by one to test yourself.

26. Why does the project use minimum SDK 26?

  1. Retrofit needs API 34
  2. Material 3 needs Android 14
  3. java.time works without extra setup and almost all phones support it
  4. Supabase only works on Android 8

Answer: C) java.time works without extra setup and almost all phones support it

Explanation: java.time is available natively from API 26.

Discuss this question

27. Why does AboutActivity override shouldOverrideUrlLoading?

  1. To block the page
  2. To cache the page
  3. To open mailto and web links in the right apps instead of inside the WebView
  4. To enable JavaScript

Answer: C) To open mailto and web links in the right apps instead of inside the WebView

Explanation: Returning true means the app handled the link.

Discuss this question

28. RegisterActivity sends the new email back to AuthActivity using:

  1. SharedPreferences only
  2. setResult(RESULTOK, Intent().putExtra("email", email))
  3. A global static variable
  4. A notification

Answer: B) setResult(RESULTOK, Intent().putExtra("email", email))

Explanation: Lab 4 – activity result with an extra.

Discuss this question

29. deleteEvent sends @Query("id") with the value "eq.$id" because:

  1. Retrofit cannot send plain ids
  2. PostgREST filters use column=operator.value
  3. Supabase needs the word eq in every URL
  4. It encrypts the id

Answer: B) PostgREST filters use column=operator.value

Explanation: DELETE /rest/v1/events?id=eq.<id.

Discuss this question

30. Which habit saves battery in CampusPulse?

  1. Using a WebView for every screen
  2. Reading location once on request and stopping timers when screens are hidden
  3. Keeping GPS on all the time
  4. Polling the server every second

Answer: B) Reading location once on request and stopping timers when screens are hidden

Explanation: Week 17 – performance/power trade-offs.

Discuss this question

31. With isMinifyEnabled = true, why add a -keep rule for the data classes?

  1. To keep the splash screen
  2. To make the app faster
  3. To enable dark mode
  4. So R8 does not rename fields that Gson reads from JSON

Answer: D) So R8 does not rename fields that Gson reads from JSON

Explanation: Gson uses field names via reflection.

Discuss this question

32. Where are SUPABASEURL and SUPABASEKEY kept so they are not uploaded to GitHub?

  1. colors.xml
  2. AndroidManifest.xml
  3. local.properties, read into BuildConfig
  4. strings.xml

Answer: C) local.properties, read into BuildConfig

Explanation: local.properties is ignored by Git.

Discuss this question

33. A second user cannot see your Delete button, and even a direct API delete removes nothing because:

  1. Supabase blocks DELETE completely
  2. The APK is signed
  3. RLS only matches rows where auth.uid() = userid
  4. The button is disabled by Material 3

Answer: C) RLS only matches rows where auth.uid() = userid

Explanation: Server-side security does not trust the UI.

Discuss this question

34. Reading events with only the apikey header (no user token) returns [] because:

  1. The select policy is only for authenticated users
  2. The table is empty
  3. Gson failed
  4. The URL is wrong

Answer: A) The select policy is only for authenticated users

Explanation: anon has no select policy.

Discuss this question

35. @SerializedName("startsat") on startsAt means:

  1. The field is the primary key
  2. The field is optional in Java
  3. Gson maps the JSON/database name startsat to the Java field startsAt
  4. The field is encrypted

Answer: C) Gson maps the JSON/database name startsat to the Java field startsAt

Explanation: Java camelCase ↔ database snakecase.

Discuss this question

36. In CampusPulse, which layer is the only part that changes when moving from offline data to Supabase?

  1. The manifest only
  2. The Repository (data layer)
  3. All fragments
  4. The layouts

Answer: B) The Repository (data layer)

Explanation: Screens call Repository; Step 8 replaces only Repository.java.

Discuss this question

37. Which header does the OkHttp interceptor add to every request?

  1. Authorization: Bearer <secret key
  2. Content-Length
  3. Prefer: return=representation
  4. apikey: <publishable key

Answer: D) apikey: <publishable key

Explanation: The user token is added per call as Authorization.

Discuss this question

38. Why didn't any fragment change in Step 8?

  1. Screens depend only on Repository functions, whose names and types stayed the same
  2. They were deleted
  3. Android regenerates them
  4. Fragments read Supabase directly

Answer: A) Screens depend only on Repository functions, whose names and types stayed the same

Explanation: Separation of presentation and data tiers.

Discuss this question

39. Adding contentDescription to images mainly helps:

  1. Dark mode
  2. Users of screen readers (TalkBack)
  3. Supabase queries
  4. APK signing

Answer: B) Users of screen readers (TalkBack)

Explanation: Accessibility.

Discuss this question

40. Why are dates sent to the cloud with Time.toIso(...) including an offset (e.g. +05:00)?

  1. To make the text shorter
  2. So the database stores the exact instant and every phone shows the right local time
  3. Because Supabase only accepts UTC strings
  4. Because Gson needs it

Answer: B) So the database stores the exact instant and every phone shows the right local time

Explanation: timestamptz needs a time zone to store the correct instant.

Discuss this question

41. DynamicColors.applyToActivitiesIfAvailable(this) makes the app:

  1. Use colours from the wallpaper on Android 12+
  2. Switch to dark mode
  3. Load colours from Supabase
  4. Use random colours

Answer: A) Use colours from the wallpaper on Android 12+

Explanation: Dynamic colour = Material You.

Discuss this question

42. Intent.ACTIONDIAL with tel:0511234567 will:

  1. Send an SMS
  2. Need the CALLPHONE permission
  3. Call immediately
  4. Open the dialer with the number, without calling

Answer: D) Open the dialer with the number, without calling

Explanation: ACTIONDIAL needs no permission.

Discuss this question

43. In CampusPulse, the four tabs are implemented as:

  1. Four separate apps
  2. Dialogs
  3. Four WebViews
  4. Fragments inside MainActivity swapped by BottomNavigationView

Answer: D) Fragments inside MainActivity swapped by BottomNavigationView

Explanation: Lab 5 – one host activity, many fragments.

Discuss this question

44. app:showAsAction="ifRoom" on the Refresh item means:

  1. Show it as an icon on the toolbar if there is space
  2. Show it only in landscape
  3. Show it in the bottom bar
  4. Hide it always

Answer: A) Show it as an icon on the toolbar if there is space

Explanation: Otherwise it goes in the overflow (⋮) menu.

Discuss this question

45. Which method inflates the toolbar menu?

  1. onStart()
  2. onCreateView()
  3. onCreateOptionsMenu()
  4. onBindViewHolder()

Answer: C) onCreateOptionsMenu()

Explanation: Lab 8 – menuInflater.inflate(R.menu.mainmenu, menu).

Discuss this question

46. Why does FeedbackFragment cancel the timer in onDestroyView()?

  1. To send feedback faster
  2. So a timer never updates a screen that no longer exists
  3. Because timers cost money
  4. To clear SharedPreferences

Answer: B) So a timer never updates a screen that no longer exists

Explanation: Avoids crashes and wasted work.

Discuss this question

47. Which theme parent gives Material 3 with automatic light/dark support?

  1. android:Theme.Black
  2. Theme.Material3.DayNight.NoActionBar
  3. Theme.Holo.Light
  4. Theme.AppCompat.Light.DarkActionBar

Answer: B) Theme.Material3.DayNight.NoActionBar

Explanation: DayNight follows the night-mode setting.

Discuss this question

48. The About page HTML file is loaded with:

  1. SharedPreferences
  2. startActivity(ACTIONVIEW)
  3. webView.loadUrl("file:///androidasset/about.html")
  4. Retrofit

Answer: C) webView.loadUrl("file:///androidasset/about.html")

Explanation: Assets are read from file:///androidasset/.

Discuss this question

49. After EventAdapter.setItems(list) replaces the data, why must it call notifyDataSetChanged()?

  1. It makes items clickable
  2. So the RecyclerView redraws its rows with the new data
  3. It is required by Supabase
  4. It sorts the list by date

Answer: B) So the RecyclerView redraws its rows with the new data

Explanation: The adapter must tell the RecyclerView that its data changed.

Discuss this question

50. What does the OkHttp Authenticator (TokenRefresher) in Network.java do on a 401 response?

  1. Shows a notification
  2. Refreshes the access token once and retries the call
  3. Switches to offline data
  4. Deletes the account

Answer: B) Refreshes the access token once and retries the call

Explanation: Access tokens expire after about an hour.

Discuss this question

Previous Page 2 of 3 Next

Practise Course Project: Build a Modern Cloud App Step by Step MCQs

More Computer Science chapters