Skip to content

Commit

Permalink
Update NetworkManager.java
Browse files Browse the repository at this point in the history
I tried to use Ethernet link to my Android tablet using this cable

http://www.amazon.co.uk/Smays-Micro-USB-Ethernet-Computer-Notebook/dp/B009XU6N54

I noticed my app returned Network = None.

So I added this little patch so the app now works over Ethernet link.
  • Loading branch information
VinuL committed Aug 27, 2015
1 parent 7caab25 commit 82fed3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/android/NetworkManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class NetworkManager extends CordovaPlugin {

public static final String WIFI = "wifi";
public static final String WIMAX = "wimax";
public static final String ETHERNET = "ethernet";
// mobile
public static final String MOBILE = "mobile";

Expand Down Expand Up @@ -240,6 +241,9 @@ private String getType(NetworkInfo info) {
if (type.equals(WIFI)) {
return TYPE_WIFI;
}
else if (type.toLowerCase().equals(ETHERNET)) {
return TYPE_ETHERNET;
}
else if (type.equals(MOBILE) || type.equals(CELLULAR)) {
type = info.getSubtypeName();
if (type.equals(GSM) ||
Expand Down

0 comments on commit 82fed3f

Please sign in to comment.