Connection detection (cellular/WiFi,...) - Forum

Forum Navigation
You need to log in to create posts and topics.

Connection detection (cellular/WiFi,...)

Hello,

I have an android-app created in Visualneo Web.

To protect users from large download usage, I would like to prevent certain links from being opened with cellular (4G) connection.
Anyone have an idea if there is a plugin / script for that?
Idea: connection detection,

  • If 4G (cellular) → message, and link does not work
  • If WiFi → link works

Thanks in advance!

Grtz,

 

@guust, I think there is not an easy way yet.
Please take a look here.
Perhaps it can work under Android.
If you get success let us know.
Best regards.

Thanks for the quick answer!

For Windows it was simple:

CheckInternetConnection "[Internet]"

and you have a variable if there is internetconnection.

I'll try with a JS-code, but I can't create a variable to store, and check if cellular is connected.

function check() {
  if (navigator.connection) {
    var type = navigator.connection.type;
    if(type) {
      if(type == "cellular") {
        alert("Attention! Les données mobiles (4G) sont activées! Éteignez-le avant d'ouvrir cette application! Lorsqu'il est utilisé sur un réseau 4G, l'administrateur réseau peut facturer des frais supplémentaires!")



    }
  }
  }
}

check();

 

 

 

@guust, if you only want to know if there is an available Internet connection then use the attached plugin and sample app.
You can test any URL (ie google.com) with a timeout, if there is not response then there is not Internet connection.

Regards.

Uploaded files:
  • You need to login to have access to uploads.
Vadim and Samuel Vanneste have reacted to this post.
VadimSamuel Vanneste