# cordova-plugin-advance-network-action

> A Cordova plugin to use network with advance functions

Latest version **1.0.6** (published 2017-02-06) · AGPL license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-advance-network-action
pnpm add cordova-plugin-advance-network-action
yarn add cordova-plugin-advance-network-action
bun add cordova-plugin-advance-network-action
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2017-02-06 |
| First published | 2017-01-30 |
| Weekly downloads | 0 |
| License | AGPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | r1si |
| Maintainers | r1si |
| Keywords | cordova, network, changeNetwork |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-advance-network-action
- Repository: https://github.com/r1si/cordova-plugin-advance-network-action
- Homepage: https://github.com/r1si/cordova-plugin-advance-network-action#readme
- Issues: https://github.com/r1si/cordova-plugin-advance-network-action/issues
- npm.io page: https://npm.io/package/cordova-plugin-advance-network-action

## Recent versions

- 1.0.6 (latest) — 2017-02-06
- 1.0.5 — 2017-02-06
- 1.0.4 — 2017-02-01
- 1.0.3 — 2017-01-31
- 1.0.2 — 2017-01-31
- 1.0.1 — 2017-01-30
- 1.0.0 — 2017-01-30

## README

#DO NOT WORK! IN DEVELOP PLEASE NOT USE IT
# Cordova plugin advance network action

A Cordova plugin to do some network action, for now only on android
Here what you can do:
* Change network
* get network activty


## Installation

Cordova:
```
cordova plugin add cordova-advance-network-action
```

Phonegap:
```
phonegap plugin add cordova-advance-network-action
```

## Usage

### changeNetwork
[ANDROID][ROOT REQUIRED]  
Function to change network activity with the following value:  
* "2G"
* "3G"
* "4G"
* "2G/3G"
* "2G/3G/4G"

It returns true if can change network, else false if it fails

```
advance_network.changeNetwork("2G",function(res) {
    if(res == "true"){
        console.log("network change!");
    }else{
        console.log("Eror during changing network");
    }
}, function() {
    console.error('An error occoured while do the command');
});
```

### getDeviceNetwokActivity
[ANDROID]  
Function that get the current device network activity  
It return an int number with this value:
* 0 = DATA_ACTIVITY_NONE - Data connection activity: No traffic.  
* 1 = DATA_ACTIVITY_IN - Data connection activity: Currently receiving IP PPP traffic.  
* 2 = DATA_ACTIVITY_OUT - Data connection activity: Currently sending IP PPP traffic.  
* 3 = DATA_ACTIVITY_INOUT - Data connection activity: Currently both sending and receiving IP PPP traffic.  
* 4 = DATA_ACTIVITY_DORMANT - Data connection is active, but physical link is down  

```
advance_network.getDeviceNetwokActivity(function(res) {
        alert(res); // debug value
    },function(res) {
        console.error("Error form plugin");
    });
```

---
_Source: https://npm.io/package/cordova-plugin-advance-network-action · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
