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. QNetworkConfigurationManager onlineStateChanged SIGNAL && Android, iOS ApplicationState Suspended
Forum Updated to NodeBB v4.3 + New Features

QNetworkConfigurationManager onlineStateChanged SIGNAL && Android, iOS ApplicationState Suspended

Scheduled Pinned Locked Moved Solved Mobile and Embedded
networkandroidios
5 Posts 2 Posters 2.7k Views 2 Watching
  • 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.
  • ekkescornerE Offline
    ekkescornerE Offline
    ekkescorner
    Qt Champions 2016
    wrote on last edited by
    #1

    in some of my apps I'm using a server queue where all requests are queued while the APP is offline. If network state changes to online the oldest request will be executed and so on.

    With Android and iOS - if I understand it right - if APP changed ApplicationState from Active to Suspended I'm getting a small amount of time to cleanup and then nothing will happen until ApplicationState changes back to Active.

    If Device changes onLine state while the APP is suspended - what will happen with onlineStateChanged SIGNAL ?
    Will I get the SIGNAL when APP becomes Active again ?
    Or do I have to ask QNetworkConfigurationManager isOnline() to get the actual value ?

    ekke ... Qt Champion 2016 | 2024 ... mobile business apps
    5.15 --> 6.9 https://t1p.de/ekkeChecklist
    QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

    ekkescornerE 1 Reply Last reply
    0
    • ekkescornerE ekkescorner

      in some of my apps I'm using a server queue where all requests are queued while the APP is offline. If network state changes to online the oldest request will be executed and so on.

      With Android and iOS - if I understand it right - if APP changed ApplicationState from Active to Suspended I'm getting a small amount of time to cleanup and then nothing will happen until ApplicationState changes back to Active.

      If Device changes onLine state while the APP is suspended - what will happen with onlineStateChanged SIGNAL ?
      Will I get the SIGNAL when APP becomes Active again ?
      Or do I have to ask QNetworkConfigurationManager isOnline() to get the actual value ?

      ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote on last edited by
      #2

      @ekkescorner from my tests it seems Qt is really smart :)
      APP is online
      suspend app
      switch to airplane mode and a minute later back
      open APP - as soon as get Active, both SIGNALS (off, on) are delivered correct

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.9 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      ekkescornerE 1 Reply Last reply
      1
      • ekkescornerE ekkescorner

        @ekkescorner from my tests it seems Qt is really smart :)
        APP is online
        suspend app
        switch to airplane mode and a minute later back
        open APP - as soon as get Active, both SIGNALS (off, on) are delivered correct

        ekkescornerE Offline
        ekkescornerE Offline
        ekkescorner
        Qt Champions 2016
        wrote on last edited by ekkescorner
        #3

        @ekkescorner so it seems no signal gets lost. (my experiences on Android - have to test from iOS, too)

        but if getting onlineStateChanged() will cause execution of some complex code,
        probably it would be good only to detect the last change and not always swapping between ON and OFF if user was in area with bad network coverage.

        should I disconnect if APP will be suspended and if becomes Active check the state and re-connect to the SIGNAL ?

        What are you doing ?

        ekke ... Qt Champion 2016 | 2024 ... mobile business apps
        5.15 --> 6.9 https://t1p.de/ekkeChecklist
        QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          Depending on what your application needs to do when coming back online, I'd use a clearable debounce timer to ensure it doesn't start too early if connection quality is bad.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          ekkescornerE 1 Reply Last reply
          0
          • SGaistS SGaist

            Hi,

            Depending on what your application needs to do when coming back online, I'd use a clearable debounce timer to ensure it doesn't start too early if connection quality is bad.

            ekkescornerE Offline
            ekkescornerE Offline
            ekkescorner
            Qt Champions 2016
            wrote on last edited by
            #5

            @SGaist thx - have thought the same.
            would work well if Active and bad coverage or coming back from suspended when multi signals are received

            ekke ... Qt Champion 2016 | 2024 ... mobile business apps
            5.15 --> 6.9 https://t1p.de/ekkeChecklist
            QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

            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