简体   繁体   中英

Python for Android (p4a): How to pass arguments in a .p4a file

Instead of using Buildozer, I changed to P4a. Buildozer used the buildozer.spec for arguments and I'm assuming the .p4a is the equivalent of this. According to docs I stumbled across, I just add a .p4a to my project root and p4a will find it.

What I don't know is, what are all the argument types you can pass to the build? For instance, can you add to the manifest.xml through the .p4a file?

How would I add android permissions to the .p4a? I'm assuming the layout is different from the buildozer.specs. Is there any fully written docs on the .p4a files, listing all the argument types and how they should be written?

My Distb Directory ended up being /.local.. Is there anyway to change this directory out put?

I'm assuming the .p4a is the equivalent of this

python-for-android doesn't depend on a config file like buildozer does, but this is one way to do it. In the long term, I think the distutils integration will be more convenient for full projects.

What I don't know is, what are all the argument types you can pass to the build?

Everything you might normally pass to p4a, the file is just a list of command line arguments with exactly the same syntax, one per line.

You can find information about these arguments in the python-for-android documentation or on the command line with eg p4a apk --help . This doesn't list arguments relating to the final stage of the build for internal reasons relating to how the arguments are passed through, so you'll have to get these from the references in the documentation for now.

How would I add android permissions to the .p4a?

The argument for this is --permission , eg --permission VIBRATE . For multiple permissions, pass multiple --permission arguments.

My Distb Directory ended up being /.local.. Is there anyway to change this directory out put?

The argument for this is --storage-dir PATH , where PATH is the folder you want to use. You can see the command line documentation for this, and other parameters, with p4a apk --help .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM