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. Qt6.5 / Android -> Get App on top of LockScreen

Qt6.5 / Android -> Get App on top of LockScreen

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 258 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.
  • F Offline
    F Offline
    Flaming Moe
    wrote on 11 Oct 2023, 17:44 last edited by
    #1

    Aloá,

    first I describe what my goal is an then, how I approached it until now.
    If someone knows a different way to do it - I´d buy that :)

    Goal:
    I want the App on Android to be in front of the LockScreen, since it has the function of an Alarm-Clock. I already managed to start it at a scheduled time, but haven´t achieved yet to put it in front of the LockScrren.

    Current Approach:
    My current approach is to do following in a java class:

    getWindow().setFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED, WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    

    This requires the java class to extend ...QtActivity.
    =>
    Therefore in turn I can´t make the class static, because getWindow() can´t be called from a static context.
    Furthermore it seems, when extending ...QtActivity" I can not simply create an instance of that java class in the c++ code in the fashion

    myCl = env.findClass("org/qtproject/example/androidnotifier/OverlayAppToLockScreen");
        obj = QJniObject(myCl, "()V");
        obj.callObjectMethod("org/qtproject/example/androidnotifier/OverlayAppToLockScreen","OverLayApp", "()V");
    

    because when extending QtActivity the methods can´t be called from the c++ code I write the App in, since that in turn runs in the worker thread (?).
    And that exceeds my horizon how to solve that.

    Does someone has an idea?

    A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Flaming Moe
      wrote on 11 Oct 2023, 18:31 last edited by
      #2

      I´m wondering, if there could be a way via an Intent. In sense of forming an Intent which - descriptivly spoken - says
      "Hey Hello Android OS, look for an App called "MyApp" and pass it the Intention with a payload to make the flag "FLAG_SHOW_WHEN_LOCKED " to be set"

      A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

      1 Reply Last reply
      0

      1/2

      11 Oct 2023, 17:44

      • Login

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