Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved How do I show a hidden window?

    QML and Qt Quick
    5
    21
    764
    Loading More Posts
    • 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.
    • M
      Mikeeeeee last edited by

      Maybe its can help?

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @Mikeeeeee last edited by

        @Mikeeeeee Yes, you have to use services if you want to run something in background on iOS/Android.

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 2
        • M
          Mikeeeeee last edited by

          There is no "android:process"in my Manifest. Where should I specify "android:process"? Are there any examples?

          1 Reply Last reply Reply Quote 0
          • M
            Mikeeeeee last edited by Mikeeeeee

            I do this in Manifest

                <service
                        android:exported="false"
                        android:enabled="true"
                        android:name=".MyService"
                        android:process=".MyService">
                </service>
            

            Me need inclute QTimer or class in MyService. How can I do this?
            May be somewhere me need use this?

            startService(getApplicationContext(), MyService.class);
            
            jsulm 1 Reply Last reply Reply Quote 0
            • jsulm
              jsulm Lifetime Qt Champion @Mikeeeeee last edited by

              @Mikeeeeee I suggest you first read this: https://doc.qt.io/qt-5/android-services.html

              "Me need inclute QTimer or class in MyService. How can I do this?" - like always maybe? Include QTimer header and use it...

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply Reply Quote 2
              • M
                Mikeeeeee last edited by

                The documentation shows a lot of code parts, but it is not clear where they should be in the code. Can I view the entire sample project?

                Pablo J. Rogina 1 Reply Last reply Reply Quote 0
                • Pablo J. Rogina
                  Pablo J. Rogina @Mikeeeeee last edited by

                  @Mikeeeeee said in How do I show a hidden window?:

                  The documentation shows a lot of code

                  you may want to look at this article about "How to create an Android service using Qt"

                  Upvote the answer(s) that helped you solve the issue
                  Use "Topic Tools" button to mark your post as Solved
                  Add screenshots via postimage.org
                  Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                  M 1 Reply Last reply Reply Quote 3
                  • M
                    Mikeeeeee @Pablo J. Rogina last edited by

                    @Pablo-J-Rogina Thanks. Q do you know where to get a project with sample code?

                    Pablo J. Rogina 1 Reply Last reply Reply Quote 0
                    • Pablo J. Rogina
                      Pablo J. Rogina @Mikeeeeee last edited by

                      @Mikeeeeee said in How do I show a hidden window?:

                      do you know where to get a project with sample code?

                      Your reply shows that you didn't even bother to have a look at the article I linked to...

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      1 Reply Last reply Reply Quote 2
                      • M
                        Mikeeeeee last edited by

                        I looked at the article and looked at the code on the git, but everything is not very clear. It is unclear why the server is needed. And whether this code is enough to start the service or whether you need something else. And if I run it, my app will also work in hide mode?

                        // java file android/src/com/kdab/training/MyService.java
                        package com.kdab.training;
                        
                        import android.content.Context;
                        import android.content.Intent;
                        import org.qtproject.qt5.android.bindings.QtService;
                        
                        public class MyService extends QtService
                        {
                            public static void startMyService(Context ctx) {
                                ctx.startService(new Intent(ctx, MyService.class));
                            }
                        }
                        
                        1 Reply Last reply Reply Quote 0
                        • M
                          Mikeeeeee last edited by Mikeeeeee

                          if i to do this, then the code is not compiled

                          <application ...
                          public class MyBroadcastReceiver extends BroadcastReceiver {
                              
                                  @Override
                              
                                  public void onReceive(Context context, Intent intent) {
                              
                                      Intent startServiceIntent = new Intent(context, MyService.class);
                              
                                      context.startService(startServiceIntent);
                              
                                  }
                              
                              }
                          1 Reply Last reply Reply Quote 0
                          • M
                            Mikeeeeee last edited by

                            Is there a simple and working example of using Android services?

                            1 Reply Last reply Reply Quote 0
                            • First post
                              Last post