Connection
The connection plugin provides information about the connection type of the device. In order to use the connection plugin in our Apache Cordova project, we need to use the following cordova plugin add
command:
> cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
Demo
In order to access the connection demo, you can click on the Connection list item. You will be introduced to the Connection page. You can click on the Get Connection Type button in order to know the current connection type of your device, as shown in the following screenshot:
The HTML page
The following code snippet shows the "connection"
page:
<div data-role="page" id="connection"> <div data-role="header"> <h1>Connection</h1> <a href="#" data-role="button" data-rel="back" data-icon="back">Back</a> </div> <div data-role="content"> <h1>Welcome to...