InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
How is Ionic different from React Native? |
|||||||||||||||
Answer»
|
||||||||||||||||
| 2. |
How will you use observables? |
|
Answer» Observables are not specific to IONIC or Angular. These are provided by RxJS library and can do a lot of tasks. They can deal with multiple values SIMULTANEOUSLY and can MANIPULATE the DATA associated with it. However, Observables will not get EXECUTED until you subscribe to them. |
|
| 3. |
What are storage options available in Ionic? |
|
Answer» STORAGE is the EASIEST way to store KEY, values and JSON objects in the Ionic Framework. Engines are used in storage. In a web application, storage will use WebSQL, IndexedDB, and local storage. Here are some of the storage AVAILABLE in ionic:
|
|
| 4. |
How are service/providers used in Ionic? |
|
Answer» SERVICES play a vital ROLE in Ionic as it provides information to the application and performs different tasks. Some of the critical services are Simple Alert, Connectivity Monitor, Google Maps and data. If you are using, REMEMBER that IMPORTING a service and adding a provider to it are the most crucial aspects. The services should only be imported into the classes where you will be using them. |
|
| 5. |
Explain the process for detecting platforms at the runtime? |
|
Answer» IONIC offers platform classes. Ionic adds different CSS classes to the <body> tag when the app is getting loaded. For instance, on IOS devices, Ionic adds platform-ios class to <body> tag. It also adds OS version classes for iOS 8 and Android 4.4 |
|
| 6. |
Is it possible to persist data between app launches? |
|
Answer» As Ionic builds HTML5 based applications behind the SCENE, localStorage and sessionStorage API can be used to persist data on MOBILE devices. However, since localStorage only STORES strings, the OBJECTS need to be stringified before saving them. It is CRITICAL to remember that localStorage has a size limit of 5MB. |
|
| 7. |
How is ionic build different from ionic prepare? You may be asked this question during your ionic interview questions and answer. |
|
Answer» Ionic PREPARE copies files directly from the www FOLDER into the www folder of the TARGET PLATFORM. Ionic build BUILDS the app’s source code to enable it to run on an emulator/ simulator/device. |
|
| 8. |
Why is the performance of Ionic apps bad on older Android devices? Can this be improved? |
|
Answer» Ionic uses the default web browser available in the DEVICE to run hybrid applications. The OLDER VERSIONS of Android DEVICES use Android’s default browser, which has less performance and compliance as compared to MODERN browsers. This can be resolved by using crosswalk with Ionic. Crosswalk will enable you to pack a Chrome webview so that your application is not relying on native Android browser. |
|
| 9. |
Can you test Ionic apps? |
|
Answer» IONIC apps are BUILT on AngularJS, which has a rich set of TEST libraries and frameworks. You can USE these frameworks to write unit tests for your apps. In addition, the live reload feature in ionic-CLI can be used to test your apps in the browser. CHROME Developer Tools or Mozilla Firefox can be used to debug and inspect Ionic apps. |
|
| 10. |
Is it possible to access mobile phone native functionality, for example, a camera, in Ionic apps? |
|
Answer» Ionic does not OFFER camera API out of the box. But since Ionic uses plugins ARCHITECTURE, you can use Cordova plugins in your applications. Ionic offers a set of Cordova EXTENSIONS that come with Angular wrappers. You can find them at ngCordova. |
|
| 11. |
What are the benefits of caching views in Ionic applications? |
|
Answer» In Ionic, caching of up to ten views is done by DEFAULT. This improves performance and ASSISTS in maintaining different states simultaneously in the views. For instance, CACHE maintains scroll POSITION in the views or the active state of BUTTONS. |
|
| 12. |
Is it possible to render a 5000 item list without affecting its scroll performance? |
|
Answer» In Ionic, there is an option for collection-repeat directive which renders ITEMS that are visible in the DOM. Therefore, even when your LISTS are long, only items that will be visible in the viewport will be rendered without DISTURBING the scroll performance. |
|
| 13. |
In Ionic applications, how can data be passed from one view to another? |
|
Answer» IONIC apps use UI-router and AngularJS. This means we can use Angular services to pass data from one view to ANOTHER. Angular services are SINGLETONS and therefore data STORED can be accessed across controllers. |
|
| 14. |
How are PhoneGap, Ionic, and Cordova different from each other? |
||||||||||||||||
Answer»
|
|||||||||||||||||