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? Retrofit needs API 34 Material 3 needs Android 14 java.time works without extra setup and almost all phones support it 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? To block the page To cache the page To open mailto and web links in the right apps instead of inside the WebView 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: SharedPreferences only setResult(RESULTOK, Intent().putExtra("email", email)) A global static variable 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: Retrofit cannot send plain ids PostgREST filters use column=operator.value Supabase needs the word eq in every URL 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? Using a WebView for every screen Reading location once on request and stopping timers when screens are hidden Keeping GPS on all the time 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? To keep the splash screen To make the app faster To enable dark mode 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? colors.xml AndroidManifest.xml local.properties, read into BuildConfig 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: Supabase blocks DELETE completely The APK is signed RLS only matches rows where auth.uid() = userid 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: The select policy is only for authenticated users The table is empty Gson failed 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: The field is the primary key The field is optional in Java Gson maps the JSON/database name startsat to the Java field startsAt 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? The manifest only The Repository (data layer) All fragments 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? Authorization: Bearer <secret key Content-Length Prefer: return=representation 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? Screens depend only on Repository functions, whose names and types stayed the same They were deleted Android regenerates them 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: Dark mode Users of screen readers (TalkBack) Supabase queries 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)? To make the text shorter So the database stores the exact instant and every phone shows the right local time Because Supabase only accepts UTC strings 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: Use colours from the wallpaper on Android 12+ Switch to dark mode Load colours from Supabase 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: Send an SMS Need the CALLPHONE permission Call immediately 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: Four separate apps Dialogs Four WebViews 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: Show it as an icon on the toolbar if there is space Show it only in landscape Show it in the bottom bar 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? onStart() onCreateView() onCreateOptionsMenu() 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()? To send feedback faster So a timer never updates a screen that no longer exists Because timers cost money 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? android:Theme.Black Theme.Material3.DayNight.NoActionBar Theme.Holo.Light 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: SharedPreferences startActivity(ACTIONVIEW) webView.loadUrl("file:///androidasset/about.html") 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()? It makes items clickable So the RecyclerView redraws its rows with the new data It is required by Supabase 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? Shows a notification Refreshes the access token once and retries the call Switches to offline data 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