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. Switch device's account on Android
Forum Updated to NodeBB v4.3 + New Features

Switch device's account on Android

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 612 Views 1 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.
  • D Offline
    D Offline
    dev_123
    wrote on last edited by
    #1

    I'm looking for functionality to switch the device's user account from an app. Like described here: https://stackoverflow.com/questions/42487602/android-how-to-programmatically-switch-users-by-user-name

    This requires on one side DevicePolicyManager.switchUser() to do the switch and on the other it seems like the app has to be an admin app, like described here https://developer.android.com/guide/topics/admin/device-admin

    How to do this with QT?

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

      Hi and welcome to devnet,

      For the first one, you will likely need something like QAndroidJniObject.

      As for the second, you will have to follow the procedure described in the documentation you linked.

      On a side note, it's Qt. QT stands for Apple QuickTime which is not what you are looking for.

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

      1 Reply Last reply
      2
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        In addition what @SGaist said, there are no direct Qt framework classes exist do the same. You need to write native code to achieve this. Using JNI methodology you should call the native code from Qt side.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        0
        • D Offline
          D Offline
          dev_123
          wrote on last edited by
          #4

          Thanks (apparently I can't mark the issue as solved).

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

            You can do that using the "Topic Tools" button.

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

            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