Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

324
Visualizações
Any simple way to get SSID name (wi-fi connection name) from HTML page for Androids and IOS

I need to get SSID name in single html page. I need to use for logging, if person is present on some location connected on certain WI-FI network.

So I need a very simple way to get current SSID name of connection. I have some tries with window.navigator.connection The next sample I use to find out if connection is WI-FI or cellular and it works:

var connection = window.navigator.connection ||
  window.navigator.mozConnection ||
  null;
if (connection === null) {
  document.getElementById('ni-unsupported').classList.remove('hidden');
} else if ('metered' in connection) {
  document.getElementById('nio-supported').classList.remove('hidden');
  [].slice.call(document.getElementsByClassName('old-api')).forEach(function(element) {
    element.classList.remove('hidden');
  });

  var bandwidthValue = document.getElementById('b-value');
  var meteredValue = document.getElementById('m-value');

  connection.addEventListener('change', function(event) {
    bandwidthValue.innerHTML = connection.bandwidth;
    meteredValue.innerHTML = (connection.metered ? '' : 'not ') + 'metered';
  });
  connection.dispatchEvent(new Event('change'));
} else {
  var typeValue = document.getElementById('t-value');
  [].slice.call(document.getElementsByClassName('new-api')).forEach(function(element) {
    element.classList.remove('hidden');
  });

  connection.addEventListener('typechange', function(event) {
    typeValue.innerHTML = connection.type;
  });
  connection.dispatchEvent(new Event('typechange'));
}

So I wonder can I use window.navigator.connection to get SSID name or any other simple way

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Solution for my issue could be retrieving an IP address by SSID name, if user is connected to the wi-fi network. Because I need to check his presence on some certain place, So I would know the name of the WI-FI Network (SSID). So, if result is some IP address it would mean that the person is present on that place. But I will need private(local) WI-FI IP address not public one So if might have some way to do that, it will be well enough. I found something on https://docs.oracle.com/javase/tutorial/networking/nifs/retrieving.html

The NetworkInterface class and get interface by name getByName():

import java.net.*;
import java.util.*;
import static java.lang.System.out;

public class ListNIFs 
{
    public static void main(String args[]) throws SocketException {
        Enumeration<NetworkInterface> nets = NetworkInterface.getNetworkInterfaces();
        
        for (NetworkInterface netIf : Collections.list(nets)) {
            out.printf("Display name: %s\n", netIf.getDisplayName());
            out.printf("Name: %s\n", netIf.getName());
            displaySubInterfaces(netIf);
            out.printf("\n");
        }
    }

    static void displaySubInterfaces(NetworkInterface netIf) throws SocketException {
        Enumeration<NetworkInterface> subIfs = netIf.getSubInterfaces();
        
        for (NetworkInterface subIf : Collections.list(subIfs)) {
            out.printf("\tSub Interface Display name: %s\n", subIf.getDisplayName());
            out.printf("\tSub Interface Name: %s\n", subIf.getName());
        }
     }
}```

So I wonder can I use this in single HTML page and how to do it if it is possible.
Or any other suggestion
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda