Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Problem in Qt + Android + Wifi

Problem in Qt + Android + Wifi

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheCrowKaka
    wrote on last edited by
    #1

    Re: Qt + Android and WiFi

    I am using Qt 5.7 with Android. I want to list the available wifi networks on a mobile and connect to one of them.
    However, this does not work. I am seeing just "Wifi" as the item in the list and not the list of networks available.
    I refer to the post on the forum where SGaist has mentioned about the problem and asked Qojote to try it with 5.6.
    Does anyone know the solution to this problem?
    My slot for searching for networks is as given here.

    void Connect_port::Search_WIFI_NW()
    {
        QIcon icon(":/Images/wifi_icon.png");
        QNetworkConfigurationManager NCM;
        ui->lst_available_NW->clear();
        NCM.allConfigurations().clear();
        NCM.updateConfigurations();
        for(int i=0 ; i < NCM.allConfigurations().count() ; i++)
        {
            qDebug()<<"NCM Count "<<NCM.allConfigurations().count()<< "Bearer = "<<NCM.allConfigurations().at(i).bearerType();
            if(NCM.allConfigurations().at(i).bearerType() == QNetworkConfiguration::BearerWLAN)
            {
                if(!NCM.allConfigurations().at(i).name().isEmpty())
                {
                    if(NCM.allConfigurations().at(i).state() == QNetworkConfiguration::Active)
                    {
                        QString star="***  ";
                        QListWidgetItem *item = new QListWidgetItem(icon,NCM.allConfigurations().at(i).name().insert(0,star), ui->lst_available_NW);
                        ui->lst_available_NW->addItem(item);
    
                    }
                    else
                    {
                        QListWidgetItem *item = new QListWidgetItem(icon, NCM.allConfigurations().at(i).name(), ui->lst_available_NW);
                        ui->lst_available_NW->addItem(item);
                    }
                }
            }
        }
    }
    

    A Qt Enthusiastic...

    1 Reply Last reply
    0
    • QojoteQ Offline
      QojoteQ Offline
      Qojote
      wrote on last edited by
      #2

      Hi,

      IMHO it is not possible to use the Bearer Management for your task. You will have to use native Java code to find WLANs and connect to them.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved