doc:appunti:prog:kivy_debian_12_android_11
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| doc:appunti:prog:kivy_debian_12_android_11 [2023/10/04 17:56] – [Writing the buildozer.spec file] niccolo | doc:appunti:prog:kivy_debian_12_android_11 [2025/11/16 18:08] (current) – [Writing the buildozer.spec file] niccolo | ||
|---|---|---|---|
| Line 78: | Line 78: | ||
| ==== Using the new venv install method ==== | ==== Using the new venv install method ==== | ||
| - | FIXME Instead of disabling the externally-managed-environment flag or instead of using the pip3 '' | + | :!: **WARNING**: |
| + | |||
| + | Instead of disabling the externally-managed-environment flag or instead of using the pip3 '' | ||
| <code bash> | <code bash> | ||
| Line 121: | Line 123: | ||
| ==== Prepare the Kivy project in user space ==== | ==== Prepare the Kivy project in user space ==== | ||
| + | |||
| + | :!: **INFO**: This procedure is **required only once** when we start a new projec. | ||
| Now it is time to prepare the Kivy project directory for the build of the Android package. You must check the following: | Now it is time to prepare the Kivy project directory for the build of the Android package. You must check the following: | ||
| Line 132: | Line 136: | ||
| < | < | ||
| + | mkdir openolyimageshare | ||
| cd openolyimageshare | cd openolyimageshare | ||
| buildozer init | buildozer init | ||
| Line 181: | Line 186: | ||
| You can use **presplash.filename** and **icon.filename** to include two artwork in your app. The // | You can use **presplash.filename** and **icon.filename** to include two artwork in your app. The // | ||
| - | In **android.permissions** you must list all the permissions that your app will require from the operating system. If you forget to declare something your app simply will not be able to do that operation. Beware that starting from Android 10 the access to the external | + | In **android.permissions** you must list all the permissions that your app will require from the operating system. If you forget to declare something your app simply will not be able to do that operation. Beware that starting from Android 10 the access to the external |
| - | ^ READ_EXTERNAL_STORAGE | + | ^ READ_EXTERNAL_STORAGE |
| ^ WRITE_EXTERNAL_STORAGE | ^ WRITE_EXTERNAL_STORAGE | ||
| - | ^ CAMERA | + | ^ CAMERA |
| ^ MANAGE_EXTERNAL_STORAGE | ^ MANAGE_EXTERNAL_STORAGE | ||
| Line 203: | Line 208: | ||
| </ | </ | ||
| - | By setting a **target API** lower than your SDK can support, you can declare what will be the highest Android version that your app is designed to be compatible with. At the moment Buildozer will try to target | + | By setting a **target API** lower than your SDK can support, you can declare what will be the highest Android version that your app is designed to be compatible with. In November 2025 the Google Play Store requires the SDK target |
| - | Declaring a **minimum API** you can tell what is the minimum Android version required by your app. | + | Declaring a **minimum API** you can tell what is the minimum Android version required by your app. We did not declared the android.minapi, |
| - | The **compile SDK** is the environment you want to use to create the app, i.e. the SDK you downloaded from Google (which generally support the higher API available at the moment). This will affects what functions and constructs you can use in your program. If you do not specify a version, Buildozer should detect the highest SDK downloaded and use it. In our case only one SDK was downloaded, and it was SDK API 31. | + | The **compile SDK** is the environment you want to use to create the app, i.e. the SDK you downloaded from Google (which generally support the higher API available at the moment). This will affects what functions and constructs you can use in your program. If you do not specify a version, Buildozer should detect the highest SDK downloaded and use it. |
| - | ==== Compiling the package ==== | + | The Android API supported by your Buildozer installation depends upon the version of **python-for-android** (**p4a**) downloaded and installed during your setup. To know what is the **target API supported by your Buildozer installation**, |
| + | |||
| + | < | ||
| + | [INFO]: | ||
| + | </ | ||
| + | |||
| + | To know what is the **Android SDK versions available**, | ||
| + | < | ||
| + | ls $HOME/ | ||
| + | android-31 | ||
| + | </ | ||
| + | |||
| + | ^ Android Version | ||
| + | | Android 15 | ||
| + | | Android 14 | ||
| + | | Android 13 | ||
| + | | Android 12L | 32 | | ||
| + | | Android 12 | ||
| + | | Android 11 | ||
| + | | Android 10 | ||
| + | | Android 9 | 28 | | ||
| + | | Android 8.1 | 27 | | ||
| + | | Android 8.0 | 26 | | ||
| + | | Android 7.1 | 25 | | ||
| + | | Android 7.0 | 24 | | ||
| + | | Android 6.0 | 23 | | ||
| + | | Android 5.1 | 22 | | ||
| + | | Android 5.0 | 21 | | ||
| + | |||
| + | ==== Compiling the package | ||
| + | |||
| + | :!: **INFO**: This is **the only procedure** to be executed whenever you want to compile a new version; the **version number** must be updated into the **main.py** source code. | ||
| + | |||
| + | Enter the project directory and edit the **main.py** source code updating the definition of the **%%__version__%%** variable (the **buildozer.spec** will refer this value to create the package name). Then choose to make a debug build: | ||
| < | < | ||
| - | # Choose debug or release build: | ||
| buildozer android debug | buildozer android debug | ||
| - | #buildozer android release | ||
| </ | </ | ||
| + | |||
| + | During this step the directory **$HOME/ | ||
| + | |||
| + | The package will be created into the **bin/** subdirectory, | ||
| + | |||
| + | When you are ready to **publish** your package, you must create the //release// binary: | ||
| + | |||
| + | < | ||
| + | buildozer android release | ||
| + | </ | ||
| + | |||
| + | In this case the package created into the **bin/** subdirectory will be named like **packagename-version-arm64-v8a_armeabi-v7a-release.aab**, | ||
| + | |||
| + | |||
| + | ===== Upgrading the build tools (Android SDK) ===== | ||
| + | |||
| + | As per November 2025, the **Google Play** requires that new packages uploaded to the store are compiled using the **SDK target 35**, this means that you have to declare '' | ||
| + | |||
| + | To check **Buildozer version** installed: | ||
| + | |||
| + | < | ||
| + | buildozer --version | ||
| + | pip3 install --user --upgrade buildozer | ||
| + | </ | ||
| + | |||
| + | To check the **python-for-android (p4a) version** installed by your Buildozer setup, enter the '' | ||
| + | |||
| + | < | ||
| + | cd $HOME/ | ||
| + | </ | ||
| + | |||
| + | and check the **pythonforandroid** Pyton module version: | ||
| + | |||
| + | < | ||
| + | python3 | ||
| + | Python 3.11.2 (main, Apr 28 2025, 14:11:48) [GCC 12.2.0] on linux | ||
| + | Type " | ||
| + | >>> | ||
| + | >>> | ||
| + | 2024.01.21 | ||
| + | </ | ||
| + | |||
| + | Update the the **Android dependencies** inside the project subdirectory **$HOME/ | ||
| + | |||
| + | < | ||
| + | cd $HOME/ | ||
| + | vi buildozer.spec | ||
| + | # In the spec file set e.g. android.api = 35 | ||
| + | buildozer android update | ||
| + | buildozer android clean | ||
| + | </ | ||
| + | |||
| + | The above command **does not update Buildozer** nor **python-for-android**, | ||
| + | |||
| + | Once you recompiled the app, look into the project **$HOME/ | ||
| + | |||
| + | <code xml> | ||
| + | < | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | If the **targetSdkVersion** did not upgrade as expected, verify you issued the command | ||
| + | |||
| + | < | ||
| + | buildozer android clean | ||
| + | </ | ||
| + | |||
| + | Other generally unnecessary cleaning commands are: | ||
| + | |||
| + | < | ||
| + | buildozer android clean_dists | ||
| + | buildozer android clean_builds | ||
| + | buildozer android clean_apk | ||
| + | rm -rf .buildozer/ | ||
| + | </ | ||
| + | |||
| ===== Web Resources ===== | ===== Web Resources ===== | ||
| Line 237: | Line 350: | ||
| * **[[https:// | * **[[https:// | ||
| * **[[https:// | * **[[https:// | ||
| + | * **[[https:// | ||
doc/appunti/prog/kivy_debian_12_android_11.1696435000.txt.gz · Last modified: by niccolo
