Skills Test Answers - PhoneGap

A "SQLError" object is:

An API library for MySQL databases
An object that indicates an error in the webpage
A callback object
An object that is thrown when an error occurs when manipulating a database



When catching exceptions and returning errors, which of the following sides are critical to warn about results?

HTML5/CSS3 callbacks
Native side callbacks
XML and JSON callbacks
JavaScript error callbacks



In order to deploy a Phonegap app to an Android device you will need a

None of these
An Android Provisioning Profile
A Phonegap Certificate
A Google Certificate



In order to deploy a Phonegap project to an iOS device you must use which IDE?

Eclipse
Xcode
Webstorm



The User Interface in Phonegap takes place in what kind of object

NetworkView
PencilView
InternetView
WebView



Cordova is the opensource foundation for Phonegap

True
FALSE



In order to build an app in Phonegap you will need to know

HTML
Objective-C
HTML and Javascript
Javascript



True or False? The Eclipse IDE can be used to debug both Javascript code and native side PhoneGap plugins in an Android app?

False
True



It is possible to use bootstrap.js in a Phonegap App

Only when deploying to tablets
Only if you remove the CSS media queries
FALSE
True



Which of these languages ​​are used by a PhoneGap app?

JavaScript
All of these
Native languages
HTML5/CSS3



Which of the following best describes a hybrid app?

One that has features of Windows and Android native application.
One that has features of IOS and Android native application.
One that has features of IOS and Windows native application.
One that has features of both a web application and a native application.



By default the first user created content in a Phonegap app is found in:

index.css
index.htm
index.html
index.js



Which Language will you need to know in order to build a custom Phonegap plugin for Android

Objective-C
Ruby
C#
Java



When can PHP be used in conjunction with a Phonegap app?

Only the Android environment supports PHP
Only when making network protocols via (XmlHTTPRequests, WebSockets,..) to communicate with backend services.
You can write any Phonegap application using PHP
You can use a plugin to enable you to write an app with PHP



What function do you need to use to communicate between the Cordova JavaScript and native environment?

cord_JS.exec
javascript.exec
cordova.get
cordova.exec



Phonegap is a

Web application framework
IDE
Mobile application framework
Javascript framework



When writing a Phonegap app for iOS you would tell Phonegap which plugins you wanted to use in which file:

main.m
libCordova.a
config.xml
Localizable.strings



Developing a Phonegap plugin for iOS requires you to interface Javascript with which language?

Python
Java
Objective-C
Cocoa Touch



Which event allows us to know when the Cordova application is fully loaded?

"ondeviceready"
event.focus()
There's no way to know when a PhoneGap app is fully loaded
"pageinit"



It is safe to make calls to the Phonegap API after which Javascript event fires:

onLoad
viewDidLoad
deviceReady
onBodyLoad



Changes to the DOM in javascript need to be triggered after which Event:

online
resume
phonegapstart
deviceready



Which language is the entry point for any plugin?

CSS3
XML
cURL
JavaScript



When creating an iOS Phonegap project from the command line the compiler creates which files?

Config.xml
All of the above
WWW folder
Default icons



Phonegap is not compatible with which Javascript framework

Zepto JS
Phonegap is compatible with all HTML, CSS and Javascript including frameworks.
Angular JS
Backbone JS



Phonegap is owned by:

Adobe
Nitobi
Microsoft
Google



Phonegap does NOT support the following Platforms

OS/2
iPad
Windows 8
Windows Phone



In order to know device reachability, we can use the following PhoneGap object:

window.open();
radio.connection
navigator.connection
navigator.connection.cell_3g



PhoneGap is ___ solution.

Paid solution
Open source
subscription solution
Framework



Regarding the Notification plugin, the "confirmCallback" is called when the user:

Presses one of the buttons on the confirmation dialog box
Answers an incoming phone call
Presses one of the buttons on the AppBrowser
Swipes to unlock their phone



What sytax would you use to execute custom code when a certain event fires:

document.exectueCode(
document.addEventListener(
window.startEvent(
window.executeCode



When writing a Phonegap app for android you would tell Phonegap which plugins you wanted to use in which file:

permissions.xml
AndroidManifest.xml
platform.xml
config.xml



The Adobe PhoneGap Build service allows compiling a project for multiple platforms in the cloud, by uploading:

HTML, CSS and Javascript assets
HTML, PHP and Sencha assets
Configuration files and Javascript logic
Web and native compiled sources



What is required to run the Phonegap Command Line Interface

Java
BSD
UNIX
Node.js



The syntax to call a native Phongap feature from within its Javascript file begins with

phonegap.start(
cordova.exec(
plugin.start(
feature.start(



jquery is a required library in a Phonegap project

TRUE
False



In order to deploy a Phonegap app to an iPhone or iPad you will need a:

A Phonegap Certificate
A Certificate from Apple
A Provisioning Profile from Apple
Provisioning Profile and Certificate from Apple (both C and D)



Phonegap requires jquery

Only the minimized version
TRUE
TRUE; jquery version 1.3 and above
False



Phonegap requires you to use XHTML

TRUE
TRUE after Phonegap version 2.3
False



Phonegap uses native UI instead of CSS to position HTML elements

False
TRUE



The "onprogress" property is most closely associated with which PhoneGap object?

FileTransfer
notification.alert
InAppBrowser
notification.confirm



What does function "camera.getPicture" do?

Open the device's default camera application
Open the device's gallery of images
Upgrade the user's camera to the latest software version
Select a photo for sharing through email, text or social media



Which of the following best describes PhoneGap's architecture?

PhoneGap has a MVC architecture.
PhoneGap has a template based architecture.
PhoneGap has a two tier architecture.
PhoneGap has a plugin-based architecture.



To which directory/directories do you copy your splash screen image for Android development?

Res/drawable directories
Resources/splash directory
Splash/draw directory
File/popout directories



When developing iOS PhoneGap plugins, you execute the plugin by using a call from:

JavaScript using window.open function
All of these are valid
JavaScript using cordova.exec function
a custom HTML5 tag



Which callback function do we need to implement in order to get info from the Compass using the CompassHeading object?

"headingSuccess"
"degreesCompass"
"compassSuccess"
"compassGo"



Which of the following objects can be graphically customized?

notification.alert
None of these
notification.confirm
notification.beep



A plugin for which native capability is currently only available with a third-party plugin

NFC
GPS data
Camera
Local data storage



Which class should be extended by Android plugins?

PhoneGapPlugin
CordovaPlugin
PluginIntent
Activity



Javascript Lambda Functions can be used in Phonegap

Only if they don't call cordova.exec
YES
Only if they are not nested
NO



In order to generate a clean, new, PhoneGap project in Android using a Terminal, we need to:

Generate iOS version before an Android version
Install an Eclipse IDE special command-line bundle
Any of the above will allow us to generate a project
Make sure that the "tools" and "platform-tools" folders are in the PATH



Anonymous Javascript functions are prohibited in Phonegap

Only if they are not contained within a Javascript closure
NO
only if they rely on variables in native code
YES



You can use high resolution graphics for retina display devices in Phonegap

Not unless the camera is 8megapixels or more
Only if you set the pixel dimensions of the container to the pixel dimension of your high resolution graphics
FALSE
True



iOS plugins should use the "pluginInitialize" method for their ______ logic.

API
startup
SQL injection
shutdown



In order to access device-level features (i.e. access to camera) in version 3.0, you must implement it as a plugin. The plugin is added (or removed) to your project by:

Using the CLI’s plugin command
Downloading from the Phonegap website
Downloading directly from Github
Manually adding to your project



The Phonegap API has a function for taking a photo with the device camera or retrieving a one from the device image gallery. Which is correct?

phonegap.takePhoto
camera.getCamera
camera.getPhoto
camera.getPicture



Which of the following events is fired when a PhoneGap application is sent to the background?

"pause"
"pagebeforeshow"
"ondeviceready"
"resume"



You can only access the camera on an iPhone when using Phonegap 2.7 and above

False
TRUE



It is possible to host a PHP server locally in Phonegap

False
TRUE



To which file in your Cordova-Android application's folder do you need to add your plugin?

res/xml/config.xml
res/plugin.xml
configPlatform/android.xml
res/drawable/cordova.xml



Which of these permissions are required when using the PhoneGap Contacts API in Android?

android.permission.READ_CONTACTS
<plugin name="Contacts" value="org.apache.cordova.ContactManager" />
android.permission.GET_ACCOUNTS, android.permission.READ_CONTACTS, android.permission.WRITE_CONTACTS
<Privilege> <Name>ADDRESSBOOK</Name> </Privilege>



The "capture" object is assigned to the navigator.device object, therefore it has _______ scope in Javascript.

global
limited
augmented
permission-based



You will need a Macintosh computer in order to produce a Phonegap app that will be distributed in the Apple iTunes App Store

False
True



In order to compile and run a Phonegap app in the iPhone simulator with Xcode you will need

A Provisioning Profile from Apple
A Certificate from Apple
None of these
A Phonegap Certificate



CSS Media Queries are required in Phonegap

TRUE
False
Only when deploying to tablets
Only for high-resolution devices



The "options" string for the InAppBrowser must not contain:

Commas
Letters
Numbers
Blank spaces



The PhoneGap Storage API is based on which database's specifications?

W3C WebHTML
PhoneSQL Database
W3C WebSQL
WWC SQLWeb



What is the main function of the localStorage object?

It provides the ability to record and play back audio files on a device
It obtains information and performs operations specific to the user's locale and timezone
It allows you to save data as key-value pairs through the W3C storage interface
It allows you to save data as key-value pairs through the user defaults of the device



To debug an app using the iOS simulator, you can use Safari’s developer tools

FALSE
True



In Phonegap for Android the MainActivity class is extended by what Cordova class

AndroidGap
PhoneGap
DroidGap
AndroidActivity



Which of the following are valid methods of the FileReader object?

readAsDataURL, truncate, moveTo
readAsDataURL, readAsText, readAsBinaryString
moveTo, copyTo, readAsBinaryString
readAsDataURL, getParent, createWriter



Cordova is distributed by

Adobe
Apache
Apple
Nitobi



Which of the following code can be used to override the back button behavior of a device?

window.addEventListener("backbuttonpressed", function() { // New behavior here }, false);
function onBackKeyDown() { // New behavior here }
function onDeviceReady() { device.backButton = function () { // New behavior here } }
document.addEventListener("backbutton", function() { // New behavior here... }, false);



Phonegap conforms to what browser protocol:

Opera
WebKit
Depends on destination OS
Mozilla



When debugging an iOS plugin's Objective-C side, which of the following lines should be added to config.xml?

None of the above
<plugin name="service_name" value="PluginClassName" />
+ (CDVPluginResult*)resultWithStatus:(CDVCommandStatus)statusOrdinal messageAs...
exec(<successFunction>, <failFunction>, <service>, <action>, [<args>]);



In Phonegap 3.0, the connection object is exposed via:

navigator.connection.WIFI
navigator.network.connection.type
navigator.connection.type



Why is using a 9-patch technique recommended for adding a SplashScreen for Android?

It's necessary to keep the splashscreen visible for several seconds before launching the app
It's necessary to avoid splashscreen distortion in different screen sizes
9-patch is not necessary in SplashScreens for PhoneGap projects
Because 9-patch improves SplashScreen image resolution



Which of the following is NOT true about the Geolocation object?

No guarantee is given that the object returns the device's actual location
It provides location information for the device
It uses synchronous functions that will block the main thread
It is based on the W3C Geolocation API Specification



Phonegap requires you to use HTML5

TRUE after Phonegap version 2.3
False
TRUE



When the executeSql method of a SQLTransaction is called it will invoke its callback with a:

SQLCallback
SQLexec.exe
SQLStatusCheck
SQLResultSet



Which of these parameters are not required when creating a Cordova project from the iOS command line?

Project name
Package location
Package name
Project location



If you wish to use Parse.com to host a database for your Phonegap app you will have to use a Plugin

False
Only if you need the internet
TRUE
Only if you are using Javascript



Which of these are NOT PhoneGap supported mobile platforms?

Firefox OS
Web OS
Tizen and Bada
(all of these)



Which format is used to encode retrieved data through the FileReader object?

MD5-SHA1
JSON format
UTF-8
base64



Which method should be overriden by an Android Plugin?

"execute"
"cordova"
"service"
"action"



If you forget to add your iOS plugin's mapping to config.xml, what could happen?

The app does not crash, but a native dialog is displayed with an error
The app crashes, and the Xcode log shows an error
The app crashes, but it will not return an error
The app does not crash, but the Xcode log shows an error



When a call to a Database object's transaction method is performed, what PhoneGap object should be used in order to invoke callbacks?

SQLTransaction
new JavaTransaction(args)
SQLResultSetRowList
SQLCallback



Phonegap uses a simplified version of Javascript

False
TRUE



Assuming you have your platform SDK, Node.js and the Phonegap utility already installed, what is the correct command for building a project for version 3.0?

$ phonegap create myproject com.example.myproject MyProject
$ cordova create myproject com.example.myproject MyProject
$ ./create myproject com.example.myproject MyProject
$ phonegap ./create myproject com.example.myproject MyProject



What PhoneGap object can be used to get the device platform name?

Platform
Device
Notification
Window.device



The default security policy for outside domain access is to:

Allow all network access to outside domains.
Forbid all network access to outside domains
Forbid network access for some dangerous domains
Allow all network aceess for some predefined domains



If you write an App in Phonegap, you will be able to run it on Android and iPhone without modifying your custom Javascript

Maybe
No
Yes



Which of the following statements is true?

All of these
The Connection object allow us to know the WiFi status, but not celullar connection
PhoneGap can't recognize the device OS that is currently running
You can use FileWriter to write to a file multiple times



When embedding Cordova's WebView on Android, what happens if you don't add the thread pool?

Web pages will not load completely
The plugins will use incorrect threads
The WebView plugin will operate at slower speeds
The plugins will have no threads to run on



Remote debugging on an iOS device is possible on some platforms by using which of the following:

Chrome
Safari
Firebug
Weinre



In Phonegap 3.0 a Plugin is called a

Tool
Interface
Feature
Plugin



Which of the following is true about the Capture object?

It is assigned to the navigator.device object, and therefore has global scope
It is assigned to the window object, and therefore has a local scope
All of these
It does support image and video capture, but not audio capture



What is the correct command for installing a Phonegap plugin via CLI? (Example: Camera plugin)

$ phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
$ phonegap plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git
$ phonegap local plugin add camera
$ cordova local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-camera.git



Regarding Android PhoneGap plugins, which thread is used to run JavaScript code in a WebView?

An activity thread
A private thread
WebCore
UI Thread



Which of the following are the two properties handled by the "batterycritical" event?

criticalLevel (to know whether the battery is below 10% or not) isPlugged (to know whether or not the device is plugged in)
level (to get battery percentage) isPlugged (to know whether or not the device is plugged in)
level (to get battery percentage) isDamaged (to know whether or not the device has a damaged battery)
None of the above is handled by the "batterycritical" event



Phonegap build can accommodate all third-party plugins for its build process?

TRUE
False



When hiding a splash screen in iOS, what value do you need for "AutoHideSplashScreen" in the config.xml file?

true
navigator.splashscreen.hide()
3000
false



In order to submit a Phonegap app to the Apple iTunes App Store you would need to use

A Phonegap Certificate
XCode and "Application Loader"
"Phonegap Build"
Only "Application Loader"



Which thread is used to execute iOS plugin methods?

UIWebView Thread
Plugin methods don't execute in any thread
WebCore Thread
UI Thread



Which of the following statements is NOT true?

In Android multiple "watchPosition" can be in effect at one time
With geolocation.watchPosition, we're able to track significant position changes
All of these are true
In iOS, multiple "watchPosition" can be in effect at one time



You will need a Macintosh computer in order to produce a Phonegap app that will run on an iPhone

TRUE
False