1. Explain advantages of PhoneGap?
One codebase can be maintained for multiple platforms
Reuse existing web developer skills
Faster development
Based on open standards
2. Explain me what is a Hybrid Mobile App?
Hybrid mobile apps are like any other apps you'll find on your phone. They install on your device. You can find them in app stores. With them, you can play games, engage your friends through social media, take photos, track your health, and much more.
3. Explain me what are the storage option does PhoneGap can access?
☛ Memory-store.js (MemoryStore)
☛ Is-store.js (LocalStorageStore)
☛ Websql-store.js (WebSqlStore)
4. How to 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).
5. Tell me what are CDNs in jQuery? Why do we use it?
CDNs(Content Delivery Networks) can offer a performance benefit by hosting jQuery on servers spread across the globe.
There are three CDNs available that host the jQuery library free of charge:
Google's Libraries API CDN (a.k.a. Google Ajax API CDN)
Microsoft's Ajax CDN
Media Temple's ProCDN (the official “jQuery CDN”)
6. Tell me how does phoneGap simplifies mobile development?
Building applications for each device–iPhone, Android, Windows Mobile and more–requires different frameworks and languages.PhoneGap will use standards-based web technologies to bridge web applications and mobile devices. PhoneGap apps are standards compliant, they're future-proofed to work with browsers as they evolve.
PhoneGap is an open source implementation of open standards. That means developers and companies can use PhoneGap for mobile applications that are free, commercial, open source, or any combination of these.
7. How to test Ionic applications?
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.
8. Can you list out some of the PhoneGap events?
Some of the PhoneGap events include
☛ Pause
☛ Resume
☛ Deviceready
☛ Offline
☛ Endcallbutton
☛ Volumedownbutton and so on
9. Tell us 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.
10. Can you list out what features are available in PhoneGap cameraoptions?
PhoneGap cameraoptions available are
☛ Quality: It tells the quality of saved image that range from [0,100]
☛ Destination Type: Choose the format of the return value. Defined in navigator.camera.DestinationType
☛ Source Type: Set the source of the picture. Defined in navigator.camera
☛ AllowEdit: Before selection of image, it allows simple editing of image
☛ Encoding Type: It determines the encoding type of the returned image
☛ TargetWidth: It determines how you can set image width
☛ TargetHeight: It tells how you can set image height
☛ Media Type: Here you can set the media type to select from
11. Tell me what are the PhoneGap Features?
☛ It allows you to package your mobile web application code and resources into a binary app and ready to distribute to Apple, Android, Palm, Symbian, and BlackBerry devices.
☛ It is not only the purpose of PhoneGap to distribute the web application to application store.
☛ It is also providing the feature to access the device hardware from web application.
12. Explain me the iOS quirks for a compass heading object?
For a compass heading object the iOS quirks are
☛ trueHeading is returned only when location services are executing through geolocation.watchlocation()
☛ For iOS>4 devices, if the mobile device is revolved or rotated and the app supports that orientation, the heading value will be reported back with respect to the current orientation
13. Tell us 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.
14. Tell me 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.
15. Do you know the difference between AIR and PhoneGap?
The most fundamental differences between AIR and PhoneGap is that you build AIR applications using tools rooted in the Flash Platform, and you can develop PhoneGap application using HTML, CSS and JavaScript. AIR applications use the AIR runtime, it enables you to have a single code base, with the exact similar expected behavior through all supported platforms. PhoneGap applications execute inside of the native web browser component for each supported platform. For separate platform, PhoneGap may behave differently.
16. Do you know what are the limitation of PhoneGap?
As the front-end uses JavaScript it does have some limitation
☛ Data processing: Compare to JavaScript native language is much faster
☛ Back-ground processing: Large number of application depends on background thread while PhoneGap API are built using JavaScript which does not support multi-threaded and hence does not support back ground processing
☛ Advanced graphics: Apps that use advanced graphics can be accessed explicitly by third party libraries, which can be best done natively
☛ Complex business logic: Number of complex business app can be accessed better with a native code
☛ Access advanced native functionality: Number of native API's are not supported by PhoneGap's API
17. Explain phoneGap architecture?
PhoneGap has a plugin-based architecture. Each device-specific feature is a plugin, which consists of javascript and native sides. Js side should be as cross-platform as possible, whereas native side can be implemented only once, for 1 device. Nevertheless built-in plugins are developed for all of the most popular platforms, so no need to reinvent the wheel.
This architecture, together with open source code, not only allows a developer to fix their bugs, but also allows them to tweak their plugins for as per requirements. Also, a developer can build his own plugin, and support any platform of his choice.
18. Do you know how you can upgrade PhoneGap?
To upgrade PhoneGap in Mac and Linux
$ sudo npm install –g phonegap
For Windows:
C:> npm install –g phonegap
19. Tell me what is the advantage of caching the views in Ionic apps?
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);
20. Tell me what is PhoneGap Build, and how is it different from PhoneGap framework?
PhoneGap is a mobile application development framework, based upon the open source Apache Cordova project. It allows you to write an app once with HTML, CSS and JavaScript, and then deploy it to a wide range of mobile devices without losing the features of a native app. PhoneGap Build is a cloud-based service built on top of the PhoneGap framework. It allows you to easily build those same mobile apps in the cloud.
21. Explain me what is PhoneGap Build, and how is it different from PhoneGap framework?
PhoneGap is a mobile application development framework, based upon the open source Apache Cordova project.It allows you to write an app once with HTML, CSS and JavaScript, and then deploy it to a wide range of mobile devices without losing the features of a native app.
PhoneGap Build is a cloud-based service built on top of the PhoneGap framework.
It allows you to easily build those same mobile apps in the cloud. Learn more about PhoneGap Build and try it out for free!
AIDL stands for Android Interface Definition Language. It handles the interface requirements between a client and a service.
23. Do you know what is PhoneGap Cordova?
Mobile market is huge with bunch of opportunities. At the same time it is really painful experience for the developers to make an application reach to the wider audience.
There are multiple platforms like android, iPhone, Blackberry, windows comes with lot different capabilities. Every platform uses different programming language syntax and different distribution process.
As the programming platforms are different, developing an application requires putting the separate development effort for different platforms.
24. Tell me what is the difference between ChildBrowser and InAppBrowser in PhoneGap?
As the name suggests, Child Browser Plugin is a plugin and can be integrated in any phonegap application.
Whereas, InAppBrowser is a phonegap API that provides the ability to spawn a browser instance from a Cordova(2.3.0) application. The API is based on standard browser capability. In a nutshell, this has the same functionality as the ChildBrowser, and has events support as well.
25. Do you know what is media.seekTo and media.getDuration function in OpenGap media API?
☛ seekTo in OpenGap Media API is a function that updates the latest position of the underlying audio file of a Media Object
☛ getDuration is a function that returns the duration of the audio file in seconds. It will return the value -1, if the duration is unknown
PhoneGap plugin contains two files
☛ JavaScript file that defines the function for accessing the native hooks
☛ Implementation files written in the native language to co-ordinate with native phone features
To create your own PhoneGap plugins, you have to
☛ Make a new directory in your ${PROJECT_DIR}/plugins directory
☛ Make a JavaScript file within that new directory
☛ Make a new Objective-C class that extends the PhoneGap command class and also in the new directory
27. Can you list out some of the PhoneGap API?
Some of the PhoneGap API are
☛ Accelerometer
☛ Camera
☛ Capture
☛ Compass
☛ Connection
☛ Contacts
☛ Device
☛ Geo-location and so on
28. Explain me 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.
29. Tell me what are some of the challenges for developers working in Android App development?
Since Android is an open source format, different Android OS have been released in different devices on different versions and upgrades. An App developed for particular OS may or may not run on another version and developer need to analyse and correct the code
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.
31. Explain me how do you pass data from one view to another in Ionic applications?
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.
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.
33. How to 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.
34. Tell us what is PhoneGap and why to use it?
PhoneGap is an open source framework, which enables you to develop applications for mobile devices by using web technologies like CSS3, JavaScript and HTML5 instead of using Java for Android, C# for windows phone devices and Objective C or Swift for iOS. It uses the native project format for each platform.
35. Explain what is the difference between PhoneGap and PhoneGap Build?
☛ PhoneGap: It is a framework for mobile application development, built upon the open source Apache Cordova project. It permits you to write an app once with CSS, JavaScript, HTML and then deploys it to a broad range of mobile devices without losing the features of a native app.
☛ PhoneGap Build: It is a cloud-based service built on top of the PhoneGap framework.