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. How to handle exceptions on Android?
Forum Updated to NodeBB v4.3 + New Features

How to handle exceptions on Android?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 1 Posters 1.1k Views 4 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.
  • S Offline
    S Offline
    sparkies
    wrote on 10 Jan 2017, 14:31 last edited by
    #1

    Hi,

    we're porting a desktop app to Android, using Qt 5.6.2 and we are making good progress but have run into a problem with Exceptions. In our desktop app we have overridden the QCoreApplication::notify method in a derived Application object to be able to catch and handle exceptions. So if I put a breakpoint anywhere into the code and then look at the call stack, I will always see that our notify method has been called and thus goes through try {} catch() where we can deal with exceptions.

    However, when I do the same on Android it seems that QApplication::notify is being called by the event dispatcher, not our implementation...

    My question is thus, what is the correct way of doing this on Android?

    Thanks for your help,

    Andres

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sparkies
      wrote on 10 Jan 2017, 15:58 last edited by
      #2

      Just as an extra bit of information. When putting a breakpoint into the notify() method I can see that some events are indeed going through this method, however, it looks like events from the UI, e.g. when user clicks a button, bypass my notify method.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sparkies
        wrote on 11 Jan 2017, 08:38 last edited by
        #3

        Did I say that it works fine in the x86 emulator but NOT when running on an actual ARM device?

        To be precise.. when I am on an x86 AVD and throw an exception in a slot connected to a button clicked() signal my implementation of QApplication::notify() gets called and it handles the exception gracefully. However, when doing the same on a Samsung Galaxy E ARM KitKat 4.4 the application aborts with SIGABRT.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          sparkies
          wrote on 11 Jan 2017, 16:30 last edited by
          #4

          I am now convinced that this is actually a bug in the ARM port and have now raised a bug. It is unfortunately a "conditio sine qua non", so if anyone here can think of a workaround please if you could let me know that would be great.

          S 1 Reply Last reply 20 Jan 2017, 15:45
          0
          • S sparkies
            11 Jan 2017, 16:30

            I am now convinced that this is actually a bug in the ARM port and have now raised a bug. It is unfortunately a "conditio sine qua non", so if anyone here can think of a workaround please if you could let me know that would be great.

            S Offline
            S Offline
            sparkies
            wrote on 20 Jan 2017, 15:45 last edited by SGaist
            #5

            this is bugreport 58070

            [edit: Added link SGaist]

            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