Edit AndroidManifest.xml file using buildozer

2,770 views
Skip to first unread message

Sahil Mahajan

unread,
Nov 5, 2015, 9:41:55 PM11/5/15
to Kivy users support
Hi all, I would like to add a broadcast receiver with an intent-filter in my AndroidManifest.xml file. I am using buildozer, so when I run buildozer android debug, it automatically updates AndroidManifest.xml based on what is in the buildozer.spec file. There is an option in buildozer.spec where I can include an XML file as an intent filter in the <activity> tag. My problem is that I want to add a broadcast receiver and intent filter outside the <activity> tag. Doing this manually doesn't work because when I want to generate an apk by running buildozer android debug, it automatically updates the XML file and erases what I wrote. Anyone know what I can do?


Thank you.

Alexander Taylor

unread,
Nov 6, 2015, 5:54:54 AM11/6/15
to Kivy users support
The simplest way may be to clone p4a locally and point buildozer at it (there's an option for this in the buildozer.spec). Then you can edit its AndroidManifest.xml and the changes will be used by buildozer.

Sahil Mahajan

unread,
Nov 8, 2015, 9:28:38 PM11/8/15
to Kivy users support
I modified this part of the buildozer.spec file:

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
android.p4a_dir = ~/kivyinstall/sahil/reply/step5_receiver/.buildozer/android/platform/python-for-android

However, when I edit the AndroidManifest.xml file found in this directory and run buildozer android debug, it still erases all the changes I made to the XML file. Did I correctly point buildozer to my local p4a? I did not clone p4a locally, rather, running buildozer android debug automatically made a .buildozer file in my app directory, which contained its own p4a directory. I found the xml file there and modified it, and copied and pasted the p4a directory in the buildozer.spec file where it says "android.p4a_dir ="

Sahil Mahajan

unread,
Nov 8, 2015, 11:10:18 PM11/8/15
to Kivy users support
I found a solution!

If you want to make specific changes to your AndroidManifest.xml file for your app while using buildozer, go to the directory [app project]/.buildozer/android/platform/python-for-android/dist/[app]/templates/AndroidManifest.tmpl.xml. This is a template of the AndroidManifest.xml file. Any changes made to this template will show in your AndroidManifest.xml file when you run buildozer android debug.

Hope this is helpful to everyone with the same problem. Thank you for your help.

Dmytro Kravchenko

unread,
Mar 13, 2021, 3:12:08 AM3/13/21
to Kivy users support
Is now change? 

понедельник, 9 ноября 2015 г. в 05:10:18 UTC+1, sahilg...@gmail.com:

Dmytro Kravchenko

unread,
Mar 13, 2021, 3:16:29 AM3/13/21
to Kivy users support
How I can change it?, for my application 

суббота, 13 марта 2021 г. в 09:12:08 UTC+1, Dmytro Kravchenko:

Dmytro Kravchenko

unread,
Mar 13, 2021, 3:18:41 AM3/13/21
to Kivy users support
i have 

 I python  : JVM exception occurred: Requires VIBRATE permission java.lang.SecurityException

I think, this about it

суббота, 13 марта 2021 г. в 09:16:29 UTC+1, Dmytro Kravchenko:
Message has been deleted

Robert

unread,
Mar 13, 2021, 11:53:21 AM3/13/21
to Kivy users support

Dmytro Kravchenko

unread,
Mar 13, 2021, 4:11:14 PM3/13/21
to Kivy users support
Thank you so much for links! =)

суббота, 13 марта 2021 г. в 17:53:21 UTC+1, Robert:
Reply all
Reply to author
Forward
0 new messages