Showing posts with label Hybrid Mobile App Interview Questions. Show all posts
Showing posts with label Hybrid Mobile App Interview Questions. Show all posts

Thursday, November 8, 2018

ionic interview questions



Ionic interview questions  OR hybrid mobile app interview questions -

1. What is Ionic Framework?
The IONIC framework is an HTML5 platform that allows web developers (UI developer) to build hybrid mobile applications. Hybrid apps are those apps that have all access of native perform functionality and or you can say it is small websites running in browser shell in the application. It is a powerful HTML5 SDK that helps peoples to build mobile apps using HTML, CSS, and JavaScript. Ionic framework mainly focus on the look and feel of the app and its UI interaction. Ionic very fits well with the front end part of your app. It is free to use under MIT license so that it can be used for personal or commercial applications/projects.


2. What are the advantages and disadvantages of building hybrid/mobile applications using the Ionic framework?
The most obvious advantages are:
1. The ionic framework builds hybrid applications using web technologies. It means web developers can very easily build mobile applications too. Also, because it uses JavaScript / angular, almost the same codebase can be used to build both iOS and Android applications.
2. Development cost is less compared to native iOS and Android applications.
3. The ionic framework is excellent for quick application ideas prototyping.
Some of the disadvantages are:
4. It is not suited for high-end graphics dependent applications or games.
5. Performances are not as good as native applications, namely animations, scrolling, and network operations.
6. As mentioned, JavaScript animations are not as performant as native animations. However, there are JavaScript / angular libraries, like chartjs, which provide decent graph UI performance on the devices.


3. Explain what is the difference between "ionic build and ionic prepare” commands?
ionic prepare copies all files from the www folder into the target platform’s www folder.
ionic build also does this but also builds the app’s source code so that it can be run on a simulator/emulator or a device.


4. Explain some of Useful Ionic Commands. 
Please check commands and its description -
1. start-  This command is used to create a new project.
2. serve- This command is used to start a local dev server for app dev/testing.
3. generate-  This command is used to generate pipes, components, pages, directives, providers, and tabs.
4. docs - This command is used to open the Ionic documentation website.
5. build - This command is used to build web assets and prepare your app for any platform targets.
6. link- This command is used to connect your local app to Ionic.
7. info - This command is used to print system/environment info.
8. login- This command is used to log in with your Ionic ID.
9. signup - This command is used to create an Ionic account.
10. upload- This command is used to upload a new snapshot of your app.
11. telemetry-  This command is used to opt in and out of telemetry.
12. config set- This command is used to set config values.
13. config get- This command is used to print config values.
14. cordova compile- This command is used to compile native platform code.
15. cordova build- This command is used to build an Ionic project for a given platform.
16. cordova emulate- This command is used to emulate an Ionic project on a simulator or emulator.
17. cordova plugin - This command is used to manage Cordova plugins.
18. cordova platform- This command is used to manage Cordova platform targets.
19. cordova resources - This command is used to automatically create icon and splash screen resources.
20. cordova prepare - This command is used to copies assets to Cordova platforms, preparing them for native builds.
21. package download- This command is used to download your packaged app.
22. package build- This command is used to start a package build.
23. package list - This command is used to list your cloud builds.
24. cordova run - This command is used to run an Ionic project on a connected device.
25. package info - This command is used to get info about a build.


5. How to use service/providers in Ionic?
Services play a very important role in Ionic as you already know they provide information to our application and perform various tasks for us. SimpleAlert, data, ConnectivityMonitor, GoogleMaps, etc. are some of the services which are built in ionic framework. There are a few points which are to be kept in mind while creating a service. Adding a provider to it, Importing a service and injecting it is the most important thing. The services should be imported into the classes where they are going to be used. When it is injected inside a constructor, a new member variable is created which can be accessed from anywhere within the class. A provider can be added in a service by two ways - Either it can be added to an individual component, or it can be added globally to the application when bootstrapping the root component.


6. Explain the difference between PhoneGap, Cordova, and Ionic?
PhoneGap is a library that exposes native mobile phone functionalities as JavaScript API. When Adobe purchased PhoneGap, its open source core was donated to the Apache Software Foundation under the name Cordova. In the beginning, there was almost no difference between Cordova and PhoneGap. Although, over the years of development, Adobe started adding a proprietary set of the services to PhoneGap. Today, it is safe to say PhoneGap is Cordova plus extra Adobe services. Ionic uses Cordova, not PhoneGap for its core tools. Beside native mobile phone functionalities, Ionic gives structure and code scalability to JavaScript applications by using AngularJS. It also provides a set of Angular directives and components to speed up application development.


7. How to use observables in an Ionic framework?
Observables are something that is not specific to Ionic or Angular. It is provided by the RxJS library. Observables are almost similar to the promises but can do a lot more. It can deal with multiple values at a time rather than just resolving one value. You can even subscribe to an observable to manipulate the data which is associated with it. Observables are considered to be “lazy”, i.e. they won’t get executed until and unless they are subscribed to. Various operations can be applied to the observables for modifying it and returning a new one. You can even create your own observable. The observable patterns are combined into one with the help of the subject which is preferred for simple implementations.


8. What is Ionic Market?
The ionic market provides ready starter, plugins, themes etc. for the developer to download them and use for their own projects.


9. How do you persist data between application launches using the Ionic framework?
As Ionic behind the scene builds HTML5 based applications, you can use localStorage and sessionStorage API to persist data on the mobile phone. However, since localStorage can only store strings, objects need to be stringified before saving. Also, it is important to mention localStorage has size limit around 5MB.


10. How do you pass data from one view to another in Ionic applications?
You can use the NavController and NavParams to send data to pages that you push


11. Give some examples of hybrid mobile app frameworks?
re are several frameworks are available for hybrid mobile app development.

• Mobile Angular UI
• Intel XDX
• PhoneGap
• Ionic
• Appcelerator Titanium
• Kendo UI


12. How can you render a 5000 item list in Ionic, without affecting scroll performance?
Ionic provides a collection-repeat directive that renders only visible items in the DOM. So even if the list is huge, like 5000 in our example, only items visible in a viewport are rendered. Thus, scroll performance is not affected.


13. How To Generating New Pipes, Tabs, Components and Pages using Ionic 3 and Angular 4?
Ionic 3 CLI Commands For Angular 4 Projects
1.     Pipes,
2.     Providers and
3.     Directives,
4.     Components,
5.     Tabs

Syntax –
-        ionic generate [pipes] [pipes-name]
-        ionic generate [providers] [providers-name]
-        ionic generate [directives] [directives-name]
-        ionic generate [components] [components-name]
-        ionic generate [tabs] [tabs-name]

Example –
-        ionic generate pipe
-        ionic generate provider
-        ionic generate directive
-        ionic generate component
-        ionic generate tabs
-        ionic generate page

-        ionic generate component demoApp
-        ionic generate page Login
-        ionic generate page register --no-module
-        ionic generate page users --constants
-        ionic generate pipe MyCustomPipe


14. What is the advantage of caching the views in Ionic apps? Provide examples.
Ionic by default caches up to ten views, which improves performance and also maintains different states in the views at the same time. For example - The cache can maintain scroll position in the views or active state of buttons.


15. What is the difference between native mobile app design and responsive web design? Do we really need both? Explain.
Mobile apps can be developed natively or as hybrid apps, while mobile-friendly websites can be developed as adaptive or responsive. The basic design process behind all of them is more or less the same. The only thing we need to consider when designing for mobile is that we have a specific set of rules we need to follow. Apple has its own, and so does Google.
When you’re designing for iOS or Android, the underlying process is the same. First, we do research that will outline best practices and show us what we can do on a certain platform and what not. Basically, research helps us we learn restrictions and take advantage of possibilities a given field.
Designers are likely to work on both native app and responsive web designs. Native apps are important because we want the user to have them on their dashboard, and this way we want to help users in their everyday activities. Some native apps can work offline while others can’t.
Responsive web design is important for SEO and Google indexing. So, if we want to have your project well-ranked on Google, you definitely go for a mobile-friendly responsive design.


Monday, October 15, 2018

iPhone XR / XS / XS Max CSS media queries



Handling the Notch on iPhone X / XR / XS / XS Max OR iPhone media queries for responsive design  -

Media queries are very useful to modify your website or hybrid apps depending on a device resolution/type. This is very important to manage resolution in different devices. It help us to present batter view of app/website to users. Below are the examples for iPhone XR / XS / XS Max CSS media queries -


/* Apple iPhone XR 1792x828px at 326ppi Media Queries */
@media only screen 
    and (device-width : 414px) 
    and (device-height : 896px) 
    and (-webkit-device-pixel-ratio : 2) { }

/* Apple iPhone XS 2436x1125px at 458ppi Media Queries */
@media only screen 
    and (device-width : 375px) 
    and (device-height : 812px) 
    and (-webkit-device-pixel-ratio : 3) { }

/* Apple iPhone XS Max 2688x1242px at 458ppi Media Queries */
@media only screen 
    and (device-width : 414px) 
    and (device-height : 896px) 
    and (-webkit-device-pixel-ratio : 3) { }


Below are the examples for iPhone X / 8 / 8 Plus CSS media queries -

/* Apple iPhone X Media Queries */
@media only screen 
    and (device-width : 375px) 
    and (device-height : 812px) 
    and (-webkit-device-pixel-ratio : 3) { }

/* Apple iPhone 8 Media Queries */
@media only screen 
    and (device-width : 375px) 
    and (device-height : 667px) 
    and (-webkit-device-pixel-ratio : 2) { }

/* Apple iPhone 8 Plus Media Queries */
@media only screen 
    and (device-width : 414px) 
    and (device-height : 736px) 
    and (-webkit-device-pixel-ratio : 3) { }



Note : If you are looking for a specific orientation. Follow below rules -

For portrait orientation add below rule :

    and (orientation : portrait) 


For landscape orientation add below rule :

    and (orientation : landscape) 



Now use above media query in your project. It helps me a lot. If you have any query please post in a comment. 

For other all Media Queries please check this link - https://allexperts16.blogspot.com/2018/06/media-queries-for-standard-devices.html

It has Media Queries for - iPads, iPad 3, iPhone 4, iPhone 5, iPhone 6, iPhone 6+, Samsung Galaxy S3, Samsung Galaxy S4, Samsung Galaxy S5, and many more. 


Saturday, June 9, 2018

Tap vs click event in ionic 2 | ionic 3 | ionic 4 | angular2 | angular4

Tap vs click event


If you are making mobile apps (tap) might be better. This is because when using (click) the action always executes, even when tapping accidentally. The (tap) won’t execute if the user holds it for a longer period. And if you want to have a button that needs to be clicked for a longer period of time you can use the (press).

Eg :

(tap)=”yourFunction()”

(click)=”yourFunction()”

Ionic interview questions | interview questions for hybrid mobile app developers

Ionic Interview Questions :-



1. What are hybrid mobile apps?

Ans : Hybrid apps are actually developed using a combination of the native and HTML5-based web features. An HTML5 mobile app is basically a web page, or chain of web pages, that are developed to run on a small screen. Hybrid development unites the best and leaves the worst points of both the native and HTML5 platforms. Hybrid app can also be called as a web app, which is initially developed using HTML5 and JavaScript and then it is wrapped in a lean native container that makes it accessible to native platform features as well. Apart, from being a bit slow platform in accessing NFC, Bluetooth, etc and requires a third party plug-in, hybrid platform has handful of advantages. A hybrid application has a potential to develop applications using Android, Windows and Blackberry in spite of the factor that each of the platform requires different development environment, language and framework. To get a prominent presence in the app store without spending significant effort for developing a different app, companies develop hybrid apps as wrappers for an existing web page. Moreover, hybrid apps are also popular because they allow cross-platform development. That means, developers can reuse the same HTML code components on different mobile operating systems, which in turn, reduces significantly the development costs. Tools like PhoneGap and Sencha Touch allow users to design and code across platforms, using the power of HTML.


2. What are the most prominent advantages and disadvantages of building applications using the Ionic framework?

Ans : The most obvious advantages are:

Ionic framework builds hybrid applications using web technologies. It means web developers can easily build mobile applications too. Also, because it uses JavaScript, almost the same codebase can be used to build both iOS and Android applications.
Development cost is less compared to native iOS and Android applications.
Ionic framework is excellent for quick application ideas prototyping.
Some of the disadvantages are:

It is not suited for high-end graphics dependent applications or games.
Performances are not as good as native applications, namely animations, scrolling, and network operations.
As mentioned, JavaScript animations are not as performant as native animations. However, there are JavaScript libraries, like tweenMAX, which provide decent animation performance on the devices.


3. Why build native apps, when hybrid apps development frameworks are there?

Ans : Some of the following could not be achieved effectively using web frameworks:
Access to platform-specific UI components, like maps, date pickers, switches, and navigation stacks.
Native mobile gesture recognizers
Complex and sophisticated threading models that help parallelize work onto multiple threads.


4. What is the difference between PhoneGap, Cordova, and Ionic?

Ans : PhoneGap is a library that exposes native mobile phone functionalities as JavaScript API. When Adobe purchased PhoneGap, its open source core was donated to the Apache Software Foundation under the name Cordova. In the beginning, there was almost no difference between Cordova and PhoneGap. Although, over the years of development, Adobe started adding a proprietary set of the services to PhoneGap. Today, it is safe to say PhoneGap is Cordova plus extra Adobe services.

Ionic uses Cordova, not PhoneGap for its core tools. Beside native mobile phone functionalities, Ionic gives structure and code scalability to JavaScript applications by using AngularJS. It also provides a set of Angular directives and components to speed up application development.


5. What are some of the disadvantages of building native apps?

Ans : Even a small change needs a recompile that slows up the developers. This become a nightmare when the codebase is very large.
Testing new functionality is cumbersome.
Calls between native and interpreted environment could end up blocking UI thread.


6. How do you persist data between application launches using Ionic framework?

Ans : As Ionic behind the scene builds HTML5 based applications, you can use localStorage and sessionStorage API to persist data on the mobile phone. However, since localStorage can only store strings, objects need to be stringified before saving. Also, it is important to mention localStorage has size limit around 5MB.


7. How do you pass data from one view to another in Ionic applications?

Ans : Ionic uses AngularJS and UI-router. It means you can use Angular services or UI-router’s state resolve to pass data from one view to another. Since Angular services are singletons, data stored in services can be accessed across other Angular controllers.

As mentioned, UI-router provides a resolve configuration. For example:

$stateProvider
.state(‘todos’, {
url: ‘/todos’,
controller: ‘TodosCtrl’,
templateUrl: ‘todos.html’,
resolve: {
todos: function(TodosService) {
return TodosService.getTodos()
}
}
})
One advantage of resolve over stateful services is better testing: as resolve injects dependencies in the controller, it is easy to test them.
8. How can you render a 5000 item list in Ionic, without affecting scroll performance?
Ans :- Ionic provides a collection-repeat directive that renders only visible items in the DOM. So even if the list is huge, like 5000 in our example, only items visible in a viewport are rendered. Thus, scroll performance is not affected.


9. Give some examples of Hybrid Mobile App Frameworks?

Ans :
Ionic
Mobile Angular UI
Intel XDX
Appcelerator Titanium
PhoneGap
Kendo UI


10. What is the advantage of caching the views in Ionic apps? Provide examples.

Ans : Ionic by default caches up to ten views, which improves performance and also maintains different states in the views at the same time. For example, the cache can maintain scroll position in the views or active state of buttons.

Caching can be disabled per view by using cache: false in UI-router’s state config, like in the following example:

$stateProvider.state(‘myState’, {
cache: false,
url : ‘/myUrl’,
templateUrl : ‘my-template.html’
})
Caching can be also disabled globally, by setting maxCache to 0:

$ionicConfigProvider.views.maxCache(0);


11. How can you detect a platform (Android or iOS) at runtime in Ionic application?

Ans : 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).


12. How can you access mobile phone native functionality in Ionic applications, for example the camera?

Ans : Ionic does not provide a camera API out of the box. However, since Ionic uses plugins architecture, and because it is based on Cordova, we can use Cordova plugins in our application. Ionic team provides a set of Cordova extensions with Angular wrappers, and they can be found at ngCordova.

To use Cordova plugins, we need to install the plugin using Ionic command install <plugin name>. In some cases, we will additionally need to add the plugin’s Angular module to your Angular application too.

To use a mobile phone’s camera in the Ionic application, we can call the camera API by using cordova-plugin-camera that is hosted on GitHub. This plugin defines a global navigator.camera object, which provides an API for taking pictures and for choosing images from the system’s image library.
13. How can you test Ionic applications?
Ans :- Ionic applications are built using AngularJS. Angular has a rich set of test libraries and frameworks such as Jasmine and Karma test runner. These frameworks can be used to write unit tests for Ionic applications. Also, ionic-CLI provides live reload feature so the application can be tested in the browser. For example, the ionic serve command can be used to load the application in any browser. Thus, we can use Chrome Developer Tools or Mozilla Firefox with Firebug to debug and inspect Ionic applications.


14. Performance of Ionic application is bad on older Android devices. Why is this, and what can be done to improve it?

Ans : 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.


15. What’s the difference between “ionic build” and “ionic prepare”?

Ans : 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.


16. How are hybrid apps different from building native apps and mobile websites?

Ans : 

Native Mobile Apps:
An application program developed for use on a specific platform or device is basically a Native mobile application. Since native apps are developed by using a particular platform, they can take advantage of the device specific software and hardware. That means- they can use inbuilt software and programs like – global positioning system (GPS) and camera. One of the best parts of native applications is that they are faster and specific to platforms like Android and iOS etc. They are usually developed by the use of integrated development environment (IDE). IDEs are best known tools for providing services like- project development, building debugging, version control and many others. However, iOS and Android applications are generated by using different languages and IDEs, there’s a lot of similarity in the techniques and the development environment. So, exploring the differences of the two languages is not a pre requisite. By simply using the tools required by the devices, programmers can develop native apps, which are at times difficult to develop.

Mobile Web Apps:
Web apps are actually not real applications; they are really websites. Their look and feel is like native applications, but they are not implemented in a similar way as native apps are implemented. They run through a browser and are typically written in HTML5. Mobile web apps can be accessed normally as users access any web page. To install the app, users are needed to navigate to a special URL and there they get the option of “installing” the app on their home screen by creating a bookmark to that page.

Basically, web apps became popular when HTML5 came and people realized that they can get native like functionality in the browser. Nowadays, when more and more websites use HTML5, the difference between web apps and regular web pages has become blurry.

Hybrid Mobile Apps:
Hybrid apps are actually developed using a combination of the native and HTML5-based web features. An HTML5 mobile app is basically a web page, or chain of web pages, that are developed to run on a small screen. Hybrid development unites the best and leaves the worst points of both the native and HTML5 platforms. Hybrid app can also be called as a web app, which is initially developed using HTML5 and JavaScript and then it is wrapped in a lean native container that makes it accessible to native platform features as well. Apart, from being a bit slow platform in accessing NFC, Bluetooth, etc and requires a third party plug-in, hybrid platform has handful of advantages. A hybrid application has a potential to develop applications using Android, Windows and Blackberry in spite of the factor that each of the platform requires different development environment, language and framework. To get a prominent presence in the app store without spending significant effort for developing a different app, companies develop hybrid apps as wrappers for an existing web page. Moreover, hybrid apps are also popular because they allow cross-platform development. That means, developers can reuse the same HTML code components on different mobile operating systems, which in turn, reduces significantly the development costs. Tools like PhoneGap and Sencha Touch allow users to design and code across platforms, using the power of HTML.

What are hybrid mobile apps?

Hybrid apps are actually developed using a combination of the native and HTML5-based web features. An HTML5 mobile app is basically a web page, or chain of web pages, that are developed to run on a small screen. Hybrid development unites the best and leaves the worst points of both the native and HTML5 platforms. Hybrid app can also be called as a web app, which is initially developed using HTML5 and JavaScript and then it is wrapped in a lean native container that makes it accessible to native platform features as well. Apart, from being a bit slow platform in accessing NFC, Bluetooth, etc and requires a third party plug-in, hybrid platform has handful of advantages. 

A hybrid application has a potential to develop applications using Android, Windows and Blackberry in spite of the factor that each of the platform requires different development environment, language and framework. To get a prominent presence in the app store without spending significant effort for developing a different app, companies develop hybrid apps as wrappers for an existing web page. Moreover, hybrid apps are also popular because they allow cross-platform development. That means, developers can reuse the same HTML code components on different mobile operating systems, which in turn, reduces significantly the development costs. Tools like PhoneGap and Sencha Touch allow users to design and code across platforms, using the power of HTML.

What are the most prominent advantages and disadvantages of building applications using the ionic framework?

The most obvious advantages are:

Ionic framework builds hybrid applications using web technologies. It means web developers can easily build mobile applications too. Also, because it uses JavaScript, almost the same codebase can be used to build both iOS and Android applications.
Development cost is less compared to native iOS and Android applications. Ionic framework is excellent for quick application ideas prototyping.


Some of the disadvantages are:


It is not suited for high-end graphics dependent applications or games. Performances are not as good as native applications, namely animations, scrolling, and network operations.

As mentioned, JavaScript animations are not as performant as native animations. However, there are JavaScript libraries, like tweenMAX, which provide decent animation performance on the devices.

Why build native apps, when hybrid apps development frameworks are there?

Some of the following could not be achieved effectively using web frameworks:

Access to platform-specific UI components, like maps, date pickers, switches, and navigation stacks.

Native mobile gesture recognizers Complex and sophisticated threading models that help parallelize work onto multiple threads.

What is the difference between phonegap, cordova, and ionic?

PhoneGap is a library that exposes native mobile phone functionalities as JavaScript API. When Adobe purchased PhoneGap, its open source core was donated to the Apache Software Foundation under the name Cordova. In the beginning, there was almost no difference between Cordova and PhoneGap. Although, over the years of development, Adobe started adding a proprietary set of the services to PhoneGap. Today, it is safe to say PhoneGap is Cordova plus extra Adobe services.
Ionic uses Cordova, not PhoneGap for its core tools. Beside native mobile phone functionalities, Ionic gives structure and code scalability to JavaScript applications by using AngularJS. It also provides a set of Angular directives and components to speed up application development.

What are some of the disadvantages of building native apps?

Even a small change needs a recompile that slows up the developers. This become a nightmare when the codebase is very large. Testing new functionality is cumbersome. Calls between native and interpreted environment could end up blocking UI thread.

How do you persist data between application launches using ionic framework?

As Ionic behind the scene builds HTML5 based applications, you can use localStorage and sessionStorage API to persist data on the mobile phone. However, since localStorage can only store strings, objects need to be stringified before saving. Also, it is important to mention localStorage has size limit around 5MB.

How can you render a 5000 item list in ionic, without affecting scroll performance?

Ionic provides a collection-repeat directive that renders only visible items in the DOM. So even if the list is huge, like 5000 in our example, only items visible in a viewport are rendered. Thus, scroll performance is not affected.

Give some examples of hybrid mobile app frameworks?

Best Hybrid Mobile App UI Frameworks :-


1. Ionic 

2. React Native

3. PhoneGap

4. JQuery Mobile

5. Mobile Angular UI

6. Onsen UI

7. Sencha Touch

8. Intel XDK

9. Kendo UI

10. Framework 7

11. Famo.us

12. Monaca

13. Appium

What is the advantage of caching the views in ionic apps? Provide examples

Ionic by default caches up to ten views, which improves performance and also maintains different states in the views at the same time. For example, the cache can maintain scroll position in the views or active state of buttons.

Caching can be disabled per view by using cache: false in UI-router’s state config, like in the following example:

$stateProvider.state(‘myState’, {
   cache: false,
   url : ‘/myUrl’,
   templateUrl : ‘my-template.html’
})

Caching can be also disabled globally, by setting maxCache to 0:

$ionicConfigProvider.views.maxCache(0);

How can you detect a platform (android or ios) at runtime in ionic 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).

How can you access mobile phone native functionality in ionic applications, for example the camera?

Ionic does not provide a camera API out of the box. However, since Ionic uses plugins architecture, and because it is based on Cordova, we can use Cordova plugins in our application. Ionic team provides a set of Cordova extensions with Angular wrappers, and they can be found at ngCordova.

To use Cordova plugins, we need to install the plugin using Ionic command install <plugin name>. In some cases, we will additionally need to add the plugin’s Angular module to your Angular application too.

To use a mobile phone’s camera in the Ionic application, we can call the camera API by using cordova-plugin-camera that is hosted on GitHub. This plugin defines a global navigator.camera object, which provides an API for taking pictures and for choosing images from the system’s image library.