How do I show a hidden window?
-
In desktop, the app is first expanded, then I hidden it by pressing the hidde button, in Android, it is hidden by pressing the center button.
-
wrote on 4 Aug 2020, 11:33 last edited by
But this is all for widgets. How do I do this for QML?
-
-
wrote on 4 Aug 2020, 13:31 last edited by
It is wirk in Windows
show() raise()
But what me need doing in Android?
-
You can't do that on Android
-
wrote on 4 Aug 2020, 13:54 last edited by
But the alarm clock works on Android. So I can do it. But how? When collapsing the app stops, how do I make it work collapsed?
-
@Mikeeeeee Yes, you have to use services if you want to run something in background on iOS/Android.
-
wrote on 7 Aug 2020, 07:57 last edited by
There is no "android:process"in my Manifest. Where should I specify "android:process"? Are there any examples?
-
wrote on 7 Aug 2020, 08:15 last edited by Mikeeeeee 8 Jul 2020, 08:19
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);
-
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);
@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...
-
wrote on 7 Aug 2020, 10:56 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?
-
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?
wrote on 7 Aug 2020, 12:02 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"
-
@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"
wrote on 7 Aug 2020, 12:12 last edited by@Pablo-J-Rogina Thanks. Q do you know where to get a project with sample code?
-
wrote on 7 Aug 2020, 12:16 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...
-
wrote on 7 Aug 2020, 12:47 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)); } }
-
wrote on 7 Aug 2020, 13:31 last edited by Mikeeeeee 8 Jul 2020, 13:53
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); } }
-
wrote on 10 Aug 2020, 08:02 last edited by
Is there a simple and working example of using Android services?
13/21