-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added support for include xml elements inside <manifest><application> AndroidManifest.xml #2691
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks o.k. but ...
There is no appropriate entry in tests/test_build.py. Does it really work?
Went from a deeper test of these changes. Related changes in buildozer work correctly. But in python-for-android (here) a problem exists with the name of the entry. It was surprising to see, that the new entry was accepted by p4a even before any adaptations have been done. After application of the proposed changes to p4a nothing changed. The new entry was accepted, but ignored. The problem seems to be the name. Because its a substring of another option. This might be a bug somwhere in p4a or maybe in the argument parsing library used. After replaceing 'extra-manifest-application' to 'extra-manifest-application-entry' all over buildozer and p4a the change will work. |
Yes, when I did test project (article, git), I got this problem, but when I do this decide local, everything work.
I think this way true. I will change code. |
I did it. Updated to "extra-manifest-application-entry". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requested changes have been applied. So this will be o.k.
May I ask when these changes will be merged, I also encountered these problems. My project needs to reset the buildozer package every time, which makes it troublesome for me to modify its source code |
@tshirtman @matham If the modification is correct, can it be merged into? Please click approve, I am still modifying the library code during development, which makes me a headache |
can we get an update on this please? these changes will allow for starting on boot and restarting when reinstalled etc. the java/android hooks are necessary. this will take kivy/python-for-android to the next level and allow python apps/services to better hook into android. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @dvjdjvu !
I'm sorry for the late reply. I've left some comments.
Feel free to ping me when you're ready for a review.
@@ -851,6 +851,9 @@ def parse_args_and_make_package(args=None): | |||
ap.add_argument('--extra-manifest-xml', default='', | |||
help=('Extra xml to write directly inside the <manifest> element of' | |||
'AndroidManifest.xml')) | |||
ap.add_argument('--extra-manifest-application-entry', default='', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename --extra-manifest-application-entry
to --extra-manifest-application-xml
, since it adds some extra XML into <manifest><application>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can.
@@ -63,6 +63,9 @@ | |||
android:theme="{{args.android_apptheme}}{% if not args.window %}.Fullscreen{% endif %}" | |||
android:hardwareAccelerated="true" | |||
android:extractNativeLibs="true" > | |||
|
|||
{{ args.extra_manifest_application_entry }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add this snippet to all the supported bootstraps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In service_library, service_only and webview not need.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dvjdjvu please do not resolve conversations, unless it's quite clear that are resolved.
Why this is not needed on webview
, service_library
and service_only
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know what these things were for, now I have studied a little. I think you are right, it should be added.
Hi @misl6. I did the review. |
And I added choice type start service START_STICKY, START_NOT_STICKY and START_REDELIVER_INTENT. And I used this code for restart service. PythonService = autoclass('org.kivy.android.PythonService')
PythonService.mService.setAutoRestartService(True) Now you can use PythonService.mService.setTypeStartSticky()
PythonService.mService.setTypeStartNotSticky()
PythonService.mService.setTypeStartRedeliverIntent() With setTypeStartNotSticky, service doesnt close when app swipping or close. |
@dvjdjvu Feel free to ping me when you're ready with the review! |
Ok @misl6. You can merge this pull request and close it. I won't do anything else here. I removed the changes START_STICKY from here. We need to close this section. I will open new pull request for START_STICKY/START_NOT_STICKY/START_REDELIVER_INTENT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left a comment requesting more info, as I think this feature should also be added to other bootstraps, and not only sdl2.
Also, please add your feature to the python-for-android
documentation: https://github.com/kivy/python-for-android/tree/develop/doc/source
Hi @misl6, I did everythings. I hope. |
Hello @misl6, you did update? Please do it. |
any news? this is blocking |
@misl6 @lufebe16 @js-teevee, I updated the PR to the latest versions of the source code. |
@dvjdjvu I found your article today while learning Kivy and researching how to build a service that can keep running when the app closes or the phone is restarted. Thanks for the work you put out there! I was able to build and deploy your code to my docker-android container and pushed my logic to a fork from kivy_service_test. Hopefully this can help people to use your logic untill they merge it. If you want I can do a PR to your repo. Here is my fork that can help out by installing your python-for-android and buildozer fork via git with poetry: |
So is this completely dead? I just ran into the need to register a receiver in the manifest, and manually editing the template doesn't feel like a very robust or portable solution. Given the other facilities in buildozer to mutate the generated manifest, I'm surprised this functionality hasn't been merged yet/wasn't just included from the beginning. |
My changes affect builddozer and python-for-kivy.
I added support for add rules for autostart. Now you can use section in buildozer.spec:
1 updated android.extra_manifest_application to android.extra_manifest_application_entry (see below)
2 updated android.extra_manifest_application_entry to android.extra_manifest_application_xml (see below)
for add rules in AndroidManifest.xml for autostart:
This is article doesn't work Starting Kivy App and Service on bootup on Android