MCQs / Computer Science / HTML5 for Mobiles
HTML5 for Mobiles MCQs — Computer Science (page 2) 39 multiple-choice questions on HTML5 for Mobiles 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. Device pixel ratio (DPR) is: RAM ÷ storage Screen width ÷ height Battery level ÷ brightness Physical pixels ÷ CSS pixels Answer: D) Physical pixels ÷ CSS pixels
Explanation: DPR tells how many physical pixels make one CSS pixel on high-density screens.
Discuss this question
27. To load internet pages in a WebView, the manifest must contain: The INTERNET permission No permission at all The CAMERA permission The SENDSMS permission Answer: A) The INTERNET permission
Explanation: Network access requires android.permission.INTERNET.
Discuss this question
28. iOS apps display web content with: SafariFragment WebActivity WKWebView UIWebBrowser Answer: C) WKWebView
Explanation: WKWebView is the modern iOS web view.
Discuss this question
29. Which API opens the phone's native share sheet from a web page? Fetch API History API Clipboard API Web Share API (navigator.share) Answer: D) Web Share API (navigator.share)
Explanation: navigator.share() triggers the system share dialog on supported mobiles.
Discuss this question
30. Which element represents self-contained content such as a news post or card? span article nav div Answer: B) article
Explanation: article is used for independent, self-contained content.
Discuss this question
31. A PWA can work offline because of its: manifest.json Service worker caching files CSS Grid Viewport tag Answer: B) Service worker caching files
Explanation: The service worker intercepts requests and serves cached files when offline.
Discuss this question
32. Which file lets a PWA be installed to the home screen with an icon and name? sitemap.xml Web app manifest (manifest.json) robots.txt style.css Answer: B) Web app manifest (manifest.json)
Explanation: The manifest provides name, icons, start URL and display mode.
Discuss this question
33. Which JavaScript call gets the current position of a device? device.getLatLng() navigator.gps.read() window.location.get() navigator.geolocation.getCurrentPosition() Answer: D) navigator.geolocation.getCurrentPosition()
Explanation: The Geolocation API's getCurrentPosition() returns coordinates after user permission.
Discuss this question
34. The meta charset="UTF-8" tag is important for Pakistani sites because it: Allows characters of all languages, including Urdu, to display correctly Prevents zooming Makes the page load faster Enables GPS Answer: A) Allows characters of all languages, including Urdu, to display correctly
Explanation: UTF-8 encoding supports Unicode characters of all languages.
Discuss this question
35. Which input type shows a phone dial pad on mobile keyboards? text email tel number Answer: C) tel
Explanation: type="tel" opens a numeric telephone keypad.
Discuss this question
36. Which attribute prevents a form from being submitted when a field is empty? autofocus readonly placeholder required Answer: D) required
Explanation: required makes the field mandatory before submission.
Discuss this question
37. The Android component that displays web pages inside a native app is: WebView TextView ImageView ListView Answer: A) WebView
Explanation: android.webkit.WebView renders web content inside an app.
Discuss this question
38. In mobile-first CSS, media queries for larger screens usually use: max-width device-height min-width print Answer: C) min-width
Explanation: Base styles target phones; min-width queries add styles for larger screens.
Discuss this question
39. Data saved in localStorage: Is sent to the server with every request Is deleted when the tab closes Can store unlimited gigabytes Remains until it is cleared by the site or the user Answer: D) Remains until it is cleared by the site or the user
Explanation: localStorage is persistent; sessionStorage is cleared when the tab closes.
Discuss this question
Previous Page 2 of 2
Practise HTML5 for Mobiles MCQs
More Computer Science chapters