

















































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















































































Question 1. Which of the following best describes the primary advantage of using a hybrid app over a native app? A) Unlimited access to all device sensors B) Single codebase for multiple platforms C) Higher execution speed than native code D) No need for a web view component Answer: B Explanation: Hybrid apps share one HTML/CSS/JS codebase across iOS, Android, and the web, reducing development effort. Question 2. In the Ionic ecosystem, which technology is responsible for compiling Web Components that Ionic uses? A) Angular CLI B) Stencil.js C) React Native D) Cordova Answer: B Explanation: Stencil.js builds reusable, framework‑agnostic Web Components that power Ionic’s UI library. Question 3. What does the Capacitor bridge primarily enable? A) Direct communication between JavaScript and native SDKs B) Automatic conversion of CSS to native styles C) Deployment of apps to the Windows Store only D) Real‑time database syncing Answer: A
Explanation: Capacitor provides a JavaScript API that forwards calls to native code on each platform. Question 4. Which Ionic lifecycle hook is called after a component’s view has been fully initialized? A) ionViewWillEnter B) ionViewDidEnter C) ionViewWillLeave D) ionViewDidLeave Answer: B Explanation: ionViewDidEnter fires when the view is completely entered and visible to the user. Question 5. Ionic follows semantic versioning. If a release changes from 5.2.3 to 5.3.0, what type of changes are expected? A) Only bug fixes B) New backward‑compatible features C) Breaking API changes D) Patch for security only Answer: B Explanation: Incrementing the minor version (5.3.0) indicates added functionality that does not break existing APIs. Question 6. Which command creates a new Ionic page named profile using the Angular template? A) ionic generate page profile --type=angular B) ionic g component profile C) ionic generate page profile --type=angular
B) ion-list with ion-item C) ion-grid D) ion-button Answer: B Explanation: ion-list groups ion-item elements, providing a native‑styled list with icons, avatars, etc. Question 10. When using Angular Router in Ionic, which directive should you add to a button to navigate to a route named /settings? A) routerLink="/settings" B) navController.navigate("/settings") C) ion-nav="/settings" D) href="/settings" Answer: A Explanation: The routerLink directive works with Angular Router to perform client‑side navigation. Question 11. Which Ionic component is used to present a temporary message that disappears after a short period? A) ion-alert B) ion-modal C) ion-toast D) ion-popover Answer: C Explanation: ion-toast displays brief notifications that auto‑dismiss after a timeout.
Question 12. To efficiently render a list of 10,000 contacts, which component should be used? A) ion-list with ngFor only B) ion-virtual-scroll C) ion-infinite-scroll D) ion-grid with fixed height Answer: B Explanation: ion-virtual-scroll only renders items visible in the viewport, drastically reducing DOM size. Question 13. Which CSS variable controls the primary color used across Ionic components? A) --ion-color-primary B) --ion-primary-color C) --primary-color D) --color-primary Answer: A Explanation: Ionic defines color palettes via --ion-color- variables; --ion-color-primary is the main brand color. Question 14. How does Ionic automatically apply platform‑specific styling? A) By loading separate CSS files at runtime B) By using the mode attribute on each component C) By detecting the user‑agent and applying iOS or Material design tokens D) By requiring developers to write custom CSS for each platform Answer: C Explanation: Ionic detects the platform and switches between iOS (Cupertino) and Android (Material) design tokens automatically.
Explanation: The @capacitor/geolocation plugin exposes methods like getCurrentPosition and watchPosition. Question 18. What must a developer do after adding a new Capacitor plugin to ensure native projects are updated? A) Run ionic build only B) Run npx cap sync C) Delete the android and ios folders and re‑add them D) Update package.json manually Answer: B Explanation: npx cap sync copies web assets and updates native project files with new plugin definitions. Question 19. Which storage option provides a simple key‑value API that works both in the browser and on native devices? A) @ionic/storage B) SQLite directly via native plugin C) IndexedDB only D) LocalStorage only Answer: A Explanation: @ionic/storage abstracts over IndexedDB, WebSQL, and SQLite, offering a unified API. Question 20. For highly relational data requiring complex queries, which storage solution is recommended in Ionic apps? A) @ionic/storage B) LocalStorage
C) Capacitor SQLite plugin D) SessionStorage Answer: C Explanation: The SQLite plugin delivers a full relational database engine suitable for complex queries and large datasets. Question 21. Which Angular service is commonly used in Ionic to perform HTTP requests? A) HttpClient B) HttpService C) fetch API D) Axios Answer: A Explanation: Angular’s HttpClient provides a typed, observable‑based API for making RESTful calls. Question 22. How can an Ionic app globally attach an authentication token to every outgoing HTTP request? A) By adding the token manually in each service call B) Using an HTTP interceptor that modifies the request headers C) Storing the token in localStorage and reading it in components D) Using query parameters in the URL Answer: B Explanation: HTTP interceptors can automatically clone requests and add Authorization headers before they are sent. Question 23. Which Angular feature is used to protect routes that require a logged‑in user?
Question 26. Which build tool does Ionic use under the hood for bundling Angular applications? A) Webpack B) Rollup C) Parcel D) Vite Answer: A Explanation: Ionic’s Angular integration relies on the Angular CLI, which uses Webpack for module bundling. Question 27. To reduce the initial bundle size, an Ionic app should lazy load which of the following? A) Global CSS files B) Entire application root module C) Feature modules or pages D) Capacitor plugins Answer: C Explanation: Lazy loading feature modules/pages loads their code only when the user navigates to them, decreasing the first‑load size. Question 28. Which Ionic component provides a pull‑to‑refresh gesture on a list? A) ion-infinite-scroll B) ion-refresher C) ion-scroll D) ion-pullup Answer: B Explanation: ion-refresher detects the pull‑down gesture and triggers a refresh event.
Question 29. When publishing an Android app to the Play Store, which file must be generated and signed? A) unsigned APK B) keystore file only C) Signed APK or Android App Bundle (AAB) D) .ipa file Answer: C Explanation: Google Play requires a signed APK or, preferably, an AAB (Android App Bundle) for distribution. Question 30. Which command generates a signed Android App Bundle from an Ionic project? A) ionic build android --release B) npx cap build android --prod --release C) ionic capacitor build android --prod --release D) npx cap sync android --release Answer: C Explanation: ionic capacitor build android --prod --release compiles the app in production mode and creates a signed bundle. Question 31. For iOS distribution, which Apple service is used to upload the final binary? A) TestFlight only B) App Store Connect C) iTunes Classic D) Xcode Cloud only Answer: B
D) ion-action-sheet Answer: C Explanation: ion-modal can host any custom component, making it suitable for complex forms. Question 35. What is the default animation mode for Ionic components on iOS devices? A) Material Design B) No animation C) Cupertino (iOS) animation set D) Bootstrap animation Answer: C Explanation: Ionic applies the Cupertino animation set on iOS, mirroring native iOS transitions. Question 36. Which of the following is NOT a valid way to pass data to an Ionic page using the Angular Router? A) Query parameters B) Route parameters C) NavController’s push state object D) Global variable on window object Answer: D Explanation: While technically possible, using a global window variable is not a supported or recommended routing method. Question 37. In Ionic, which CSS utility class would you use to center content horizontally within a flex container? A) ion-justify-center B) ion-align-center
C) ion-text-center D) ion-center Answer: A Explanation: ion-justify-center applies justify-content: center to a flex container. Question 38. Which of the following statements about ion-infinite-scroll is true? A) It automatically loads all data at once. B) It triggers an event when the user scrolls near the bottom. C) It replaces the need for virtual scroll. D) It only works on iOS platforms. Answer: B Explanation: ion-infinite-scroll emits ionInfinite when the user approaches the end, allowing you to load more items. Question 39. How can you programmatically dismiss an active ion-loading overlay? A) loadingController.dismiss() B) loadingController.close() C) loadingController.hide() D) loadingController.remove() Answer: A Explanation: The LoadingController returns a promise with a dismiss() method to close the overlay. Question 40. Which SCSS mixin does Ionic provide to generate a color shade for a given palette? A) ion-color-shade($color) B) generate-color($name)
B) Geolocation.requestPermissions() C) Permissions.request({ name: 'geolocation' }) D) No explicit request needed; the plugin handles it automatically Answer: C Explanation: Capacitor’s Permissions API is used to request runtime permissions like geolocation. Question 44. Which Ionic component is most appropriate for displaying a set of mutually exclusive options? A) ion-checkbox B) ion-toggle C) ion-radio-group with ion-radio D) ion-select Answer: C Explanation: ion-radio-group combined with ion-radio creates a radio button list where only one option can be selected. Question 45. In Ionic Angular, what is the purpose of the ion-router-outlet element? A) It replaces the Angular router entirely. B) It provides a container for animated page transitions. C) It is used only for lazy‑loaded modules. D) It renders native iOS navigation bars. Answer: B Explanation: ion-router-outlet works with Angular Router to animate component entry and exit during navigation.
Question 46. Which of the following is a benefit of using Ionic’s CSS Variables over traditional SCSS variables? A) They can be changed at runtime without recompiling. B) They are only available during build time. C) They require a separate stylesheet per component. D) They cannot be overridden by themes. Answer: A Explanation: CSS variables are mutable in the browser, allowing dynamic theming (e.g., dark mode) without rebuilding. Question 47. When configuring a PWA with Ionic, which manifest property defines the app’s launch icon for the home screen? A) start_url B) icons C) theme_color D) background_color Answer: B Explanation: The icons array in manifest.json supplies the images used when the PWA is added to the home screen. Question 48. Which command updates all native project files after adding a new npm dependency that includes native code? A) ionic build B) npx cap sync C) ionic capacitor update D) npm install --save-native Answer: B
Answer: A Explanation: ion-gesture lets developers define complex touch gestures beyond the built‑in components. Question 52. Which of the following statements about Ionic’s lazy loading is correct? A) All pages must be declared in app.module.ts. B) Lazy loaded pages have their own NgModule file. C) Lazy loading disables route guards. D) Lazy loading only works with React. Answer: B Explanation: When lazy loading, each page resides in its own module (e.g., page.module.ts) that Angular loads on demand. Question 53. How can you enable dark mode for the entire Ionic app using CSS variables? A) Add dark-theme class to `` and define overrides in variables.scss B) Set --ion-color-primary: #000 globally C) Use prefers-color-scheme: dark media query to set new variable values D) Dark mode cannot be controlled via CSS in Ionic Answer: C Explanation: The prefers-color-scheme media query lets you supply alternative values for Ionic CSS variables when the OS requests dark mode. Question 54. Which Capacitor plugin would you use to store small amounts of data securely on iOS and Android? A) @capacitor/filesystem B) @capacitor/storage
C) @capacitor/secure-storage D) @ionic/storage Answer: C Explanation: @capacitor/secure-storage (or the community plugin) encrypts data using the platform’s keychain/keystore. Question 55. In Ionic Angular, which decorator is used to define a route that loads a module lazily? A) @Route({ path: 'home', loadChildren: () => import('./home/home.module').then(m => m.HomeModule) }) B) @NgModule({ lazy: true }) C) @IonicPage({ segment: 'home' }) D) @LazyRoute({}) Answer: A Explanation: The loadChildren property with a dynamic import tells Angular Router to lazy‑load the specified module. Question 56. When using ion-list with ion-item-sliding, what must you include to enable the swipe‑to‑reveal actions? A) ion-reorder-group B) ion-item-options inside ion-item-sliding C) ion-swipeable attribute on ion-item D) ion-swipe-actions component Answer: B Explanation: ion-item-options placed inside ion-item-sliding defines the buttons that appear when the item is swiped.