Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying JavaScript Mobile Application Development
  • Table Of Contents Toc
JavaScript Mobile Application Development

JavaScript Mobile Application Development

By : Saleh
4.8 (4)
close
close
JavaScript Mobile Application Development

JavaScript Mobile Application Development

4.8 (4)
By: Saleh

Overview of this book

If you are a native mobile developer, with some familiarity with the common web technologies of JavaScript, CSS, and HTML, or if you are a web developer, then this learning guide will add great value and impact to your work. Learning how to develop mobile applications using Apache Cordova is of particular importance if you are looking to develop applications on a variety of different platforms efficiently.
Table of Contents (10 chapters)
close
close
9
Index

Overview of Cordova APIs

Currently, Apache Cordova supports the following mobile native functions APIs:

  • Accelerometer: This allows you to capture the device motion in all directions (x, y, and z)
  • Camera: This allows you to use the default camera application in order to capture photos
  • Capture: This allows you to capture audio using the device's audio recording application, capture images using the device's camera application, and capture video using the device's video recording application
  • Compass: This allows you to get the direction that the device is pointing to
  • Connection: This provides you with the information about the device's cellular and Wi-Fi connection
  • Contacts: This allows you to access the device's contacts database, create new contacts in the contacts list, and query the existing device contacts list
  • Device: This allows you to get the hardware and software information of the device; for example, it allows you to get the device model, receive the platform and its version, and finally, receive the device name
  • Events: This allows you to listen and create handlers for Apache Cordova life cycle events. These life cycle events are as follows:
    • deviceready: This event fires once Apache Cordova is fully loaded
    • pause: This event fires if the application is put into the background
    • resume: This event fires if the application is resumed from the background
    • online: This event fires if the application becomes connected to the Internet
    • offline: This event fires if the application becomes disconnected from the Internet
    • backbutton: This event fires if the user clicks the device's back button (some mobile devices have a back button, such as Android and Windows Phone devices)
    • batterycritical: This event fires if the device's battery power reaches a critical state (that is, reaches the critical-level threshold)
    • batterylow: This event fires if the device battery power reaches the low-level threshold
    • batterystatus: This event fires if there is a change in the battery status
    • menubutton: This event fires if the user presses the device's menu button (the menu button is popular for Android and BlackBerry devices)
    • searchbutton: This event fires if the user presses the device's search button (the search button can be found in Android devices)
    • startcallbutton: This event fires when the user presses the start and end call buttons of the device
    • endcallbutton: This event fires when the user presses the start and end call buttons of the device
    • volumeupbutton: This event fires when the user presses the volume up and down buttons of the device
    • volumedownbutton: This event fires when the user presses the volume up and down buttons of the device
  • File: This allows you to process files (which is to read, write, and navigate filesystem directories), and it is based on the W3C file APIs
  • Geolocation: This allows you to receive the device's location using GPS or using network signals, and it is based on W3C geolocation APIs
  • Globalization: This allows you to get the user's locale and perform locale-specific operations
  • InAppBrowser: This represents a web browser view that is displayed when any call to window.open() or a link whose target is set to "_blank" is clicked
  • Media: This allows for the recording of audio files programmatically, without using the device default recording application, as well as playing audio files
  • Notification: This allows the display of audible notifications such as beeps, the display of tactile notifications such as vibrations, and displaying visual notifications such as the normal device visual messages to the user
  • Splashscreen: This allows you to display application splash screen
  • Storage: Apache Cordova provides the following storage capabilities:
    • Using the W3C web storage interface which is about LocalStorage and SessionStorage. It is important to know that local storage is a permanent storage that exists on your device even if your application is closed, while session storage is a temporary storage that is erased when the user session ends, which is when the application is closed.
    • Using the full features of relational databases by supporting Web SQL on almost all the platforms. For Windows Phone and Windows Platform, it supports IndexedDB, which is currently a W3C standard.

Tip

Although Web SQL is deprecated, it was and still is a powerful specification for creating and working with relational data.

All of these APIs will be illustrated in far more detail, along with examples, as you read this book. It is important to note that not all of these APIs are supported in all the platforms. You will be able to specifically check which ones are not supported in the following list. Also note that this list applies to Apache Cordova Version 3.4, and it might be changed later. The following table shows the unsupported APIs on the different platforms. Please note that X here means unsupported:

 

Firefox OS

Tizen

Windows 8

Blackberry 10

Capture API

X

X

X

 

Compass

X

   

Connection

X

   

Contacts

 

X

X

 

Events

X

   

File

X

X

  

Globalization

X

X

X

X

InAppBrowser

X

X

  

Media

X

   

Notification

X

   

Splashscreen

X

X

  

Storage

X

   
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
JavaScript Mobile Application Development
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon