Why does my android app need the ACCESS_NETWORK_STATE to run?



  • Hi everyone,
    I'm new to Qt and I want to create a small Android app,that displays an anaclock
    When I build it as .apk file with no permissions in AndroidManifest.xml,it crashes with this error report:

    ...
    JNI DETECTED ERROR IN APPLICATION: JNI GetMethodID called with pending exception java.lang.SecurityException: ConnectivityService: Neither user 10207 nor current process has android.permission.ACCESS_NETWORK_STATE
    ...
    

    and when I add the "android.permission.ACCESS_NETWORK_STATE" to AndroidManifest.xml,it runs without any problems
    I'm sure that I get the time from QTime class,then control the clock using QGraphics View
    So why does my app need that permission to run normally?
    Thanks for reading.



  • @dangnh

    Hi and welcome to devnet forum

    At least QTime is reading some information from your device. Therefore, you need some rights to do so. That is my guess.
    Probably there are a couple of different permissions which may cover also the internal clock. You simply need to have one.

    Here are the different permissions possible, search for one you like most.



  • @koahnig Thank you for your reply