ionic4 interview questions

15+ Latest Ionic Interview Questions 2020

 

What is the Ionic CLI?

The official Ionic CLI, or Command Line Interface, is a tool that quickly scaffolds Ionic apps and provides a number of helpful commands to Ionic developers. In addition to installing and updating Ionic, the CLI comes with a built-in development server, build and debugging tools, and much more. The CLI can also be used to perform cloud builds and deployments, and administer your account on Ionic Pro.

 

How would you debug apps when testing on real devices or emulators?

We can use Chrome remote debugging and other developer tools offered by Google Chrome to spot the issues within the app. Remote debugging allows us to debug live content on an Android device from our Windows, Mac, or Linux computer. Safari also allows similar features to debug an iOS app running on a Simulator or a connected iPhone.

 

What is Web View?

Ionic apps are built using web technologies and are rendered using Web Views, which are a full screen and full-powered web browser.

Modern Web Views offer many built-in HTML5 APIs for hardware functionality such as cameras, sensors, GPS, speakers, and Bluetooth, but sometimes it may also be necessary to access platform-specific hardware APIs. In Ionic apps, hardware APIs can be accessed through a bridge layer, typically by using native plugins that expose JavaScript APIs.

 

Explain the purpose of config.xml file in an Ionic project.

config.xml is a global configuration file that controls many aspects of a Cordova application’s behavior. This platform-agnostic XML file is arranged based on the W3C’s Packaged Web Apps (Widgets) specification and extended to specify core Cordova API features, plugins, and platform-specific settings.

For projects created with the Ionic CLI, this file can be found in the top-level directory. It contains vital information about the project like the package name, version, author’s information and a lot of permissions and specifications as well.

What’s The Difference Between “ionic Build” And “ionic Prepare”?

ionic prepare <platform> copies all files from the www folder into the target platform’s www folder.

ionic build <platform> also does this but also builds the app’s source code so that it can be run on a simulator/emulator or a device.

 

What is Lazy Loading?

Lazy loading is a general concept where we only load things as we need them. In Ionic 3, we would use the @IonicPage decorator to lazy load our pages, and now with Ionic 4 we lazy load our Angular components with Angular routing. The idea behind lazy loading pages is that we don’t need to load every page in the application as soon as the application is launched.

 

What is the purpose of the ion-infinite-scroll component in Ionic?

the ion-infinite-scroll component is a very useful component. It allows loading data into the app (typically in a list) as the users scroll the page. The most common use case is where the app loads more content to display to the user as the user keeps scrolling the page. This concept is used widely nowadays in almost all modern apps.

The Infinite Scroll allows us to perform an action when the user scrolls a specified distance from the bottom or top of the page. The expression assigned to the infinite event is called when the user scrolls to the specified distance. When this expression has finished its tasks, it should call the complete() method on the infinite scroll instance.

 

How Many Types Of Storage Available In Ionic Framework?

The easy way to store key or values and JSON objects are known as storage in the Ionic Framework. In these various storage, engines are used. While on the web application, the storage will tend to use IndexedDB, WebSQL, and local storage. Various types of storage are available in the ionic framework. Some of them are –

  • HTML5 local storage
  • Cookie and session storage
  • IndexedDB
  • WebSQL
  • PouchDB
  • Web service/api storage
  • Cordova storage.

 

How Can You Detect A Platform (android Or Ios) At Runtime In Ionic 3 Application?

Ionic provides platform classes: when the application is loaded, Ionic adds CSS classes to the <body> tag. For example, on iOS devices, Ionic adds platform-ios class to <body> tag. Ionic also adds OS version classes such as platform-ios8 (for iOS 8) and platform-android4_4 (for Android 4.4).

 

Can we use Firebase with Ionic?

Yes, absolutely. Firebase SDK is also available as a Node module and we can install it within our Ionic project, import it and it is ready to be used.

 

Performance Of Ionic Application Is Bad On Older Android Devices. Why Is This, And What Can Be Done To Improve It?

Ionic framework uses the default web browser available for the device to run its hybrid application. Older versions of Android devices (4.0-4.3) use Android’s default browser, which has significantly less performance and standards compliance than the modern Chrome browser.

One way to resolve this issue is to use crosswalk along with Ionic framework. Crosswalk allows you to package a modern Chrome webview along with Ionic application, so an application does not have to rely on native Android browser. The end results are much better performances and modern web API across all Android versions.

 

 

How would you save data in an Ionic app so that it can be accessed later or on the next launch?

Ionic Framework offers a Storage module that resides in the @ionic/storage package. It allows us to store key-value pairs and JSON objects in secure reliable storage, however, it has its own set of limits.

 

What is the recommended way of implementing navigation within an Ionic 4 app?

Ionic 4 depends on Angular’s router module called RouterModule for navigation. The NavController service is still there but it will be deprecated very soon and is therefore not recommended to be used in new Ionic apps built with Ionic 4.

The ion-router-outlet component is used to manage the animations that show up as the user navigates to-from a component within the app. This is the same as the router-outlet that Angular has but with some animation-related sugar added.

Name some popular apps built with the Ionic Framework?

  • Pacifica: Cognitive Behavioural Therapy
  • Sworkit: Workout and Fitness Plan
  • MarketWatch: Stock Market and Business News McDonald’ Turkiye
  • JustWatch: Streaming Search Engine Portfolio
  • Untappd: Social Discovery and Check-in Network National Museum of African American History and Culture
  • Cryptochange: Cryptocurrency Tracker