Skip to content

Commit cc6481b

Browse files
authored
Merge pull request #2718 from kivy/release-2022.12.20
Release 2022.12.20
2 parents c1ec69c + 697929b commit cc6481b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+740
-523
lines changed

.github/workflows/push.yml

-18
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,11 @@ jobs:
109109
target: testapps-with-numpy
110110
- name: webview
111111
target: testapps-webview
112-
include:
113-
- runs_on: macos-latest
114-
ndk_version: '23b'
115-
- runs_on: apple-silicon-m1
116-
ndk_version: '24'
117112
env:
118113
ANDROID_HOME: ${HOME}/.android
119114
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
120115
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
121116
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
122-
ANDROID_NDK_VERSION: ${{ matrix.ndk_version }}
123117
steps:
124118
- name: Checkout python-for-android
125119
uses: actions/checkout@v2
@@ -247,17 +241,11 @@ jobs:
247241
target: testapps-with-numpy-aab
248242
- name: webview
249243
target: testapps-webview-aab
250-
include:
251-
- runs_on: macos-latest
252-
ndk_version: '23b'
253-
- runs_on: apple-silicon-m1
254-
ndk_version: '24'
255244
env:
256245
ANDROID_HOME: ${HOME}/.android
257246
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
258247
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
259248
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
260-
ANDROID_NDK_VERSION: ${{ matrix.ndk_version }}
261249
steps:
262250
- name: Checkout python-for-android
263251
uses: actions/checkout@v2
@@ -330,18 +318,12 @@ jobs:
330318
matrix:
331319
android_arch: ["arm64-v8a", "armeabi-v7a", "x86_64", "x86"]
332320
runs_on: [macos-latest, apple-silicon-m1]
333-
include:
334-
- runs_on: macos-latest
335-
ndk_version: '23b'
336-
- runs_on: apple-silicon-m1
337-
ndk_version: '24'
338321
env:
339322
ANDROID_HOME: ${HOME}/.android
340323
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
341324
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
342325
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
343326
REBUILD_UPDATED_RECIPES_EXTRA_ARGS: --arch=${{ matrix.android_arch }}
344-
ANDROID_NDK_VERSION: ${{ matrix.ndk_version }}
345327
steps:
346328
- name: Checkout python-for-android
347329
uses: actions/checkout@v2

CHANGELOG.md

+54
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,59 @@
11
# Changelog
22

3+
## [v2022.12.20](https://github.com/kivy/python-for-android/tree/v2022.12.20) (2022-12-20)
4+
5+
[Full Changelog](https://github.com/kivy/python-for-android/compare/v2022.09.04...v2022.12.20)
6+
7+
**Fixed bugs:**
8+
9+
- `liblzma` fails to build on macOS \(sh.ErrorReturnCode\_2. when running buildozer android debug\) [\#2343](https://github.com/kivy/python-for-android/issues/2343)
10+
11+
**Closed issues:**
12+
13+
- SDL\_ttf 2.0.15 download missing \(deprecated\) related to \#2698 [\#2710](https://github.com/kivy/python-for-android/issues/2710)
14+
- Update kivy app that's already published on google play store. [\#2709](https://github.com/kivy/python-for-android/issues/2709)
15+
- Installing deepspeech [\#2702](https://github.com/kivy/python-for-android/issues/2702)
16+
- ImportError: dlopen failed: library "libc++\_shared.so" not found [\#2699](https://github.com/kivy/python-for-android/issues/2699)
17+
- ffpyplayer recipe broken after SDL2 upgrade [\#2698](https://github.com/kivy/python-for-android/issues/2698)
18+
- ModuleNotFoundError: No module named 'android' [\#2697](https://github.com/kivy/python-for-android/issues/2697)
19+
- Error When I set android.api = 31 [\#2696](https://github.com/kivy/python-for-android/issues/2696)
20+
- Is threre any way to protect .py code [\#2695](https://github.com/kivy/python-for-android/issues/2695)
21+
- args.service\_class\_name results in link error [\#2679](https://github.com/kivy/python-for-android/issues/2679)
22+
- Remove `x86_64` suffix from ndk download link [\#2676](https://github.com/kivy/python-for-android/issues/2676)
23+
- Pillow 9.2.0 recipe? [\#2671](https://github.com/kivy/python-for-android/issues/2671)
24+
- `ffmpeg`: unable to find library -lvpx [\#2665](https://github.com/kivy/python-for-android/issues/2665)
25+
- Buildozer fails while build numpy recipie 'UnixCCompiler' object has no attribute 'cxx\_compiler' [\#2664](https://github.com/kivy/python-for-android/issues/2664)
26+
- \[PEP 517\] Relax installation-time "pep517\<0.7.0" requirement [\#2573](https://github.com/kivy/python-for-android/issues/2573)
27+
- Add support for custom resources [\#2298](https://github.com/kivy/python-for-android/issues/2298)
28+
- Auto-correct / word suggestion does not work with Swiftkey/Samsung keyboard [\#2010](https://github.com/kivy/python-for-android/issues/2010)
29+
30+
**Merged pull requests:**
31+
32+
- `InputType.TYPE_TEXT_FLAG_MULTI_LINE` forces `InputType.TYPE_TEXT` even if `SDLActivity.keyboardInputType` is `NULL` [\#2716](https://github.com/kivy/python-for-android/pull/2716) ([misl6](https://github.com/misl6))
33+
- secp256k1 Update "--host=" [\#2714](https://github.com/kivy/python-for-android/pull/2714) ([RobertFlatt](https://github.com/RobertFlatt))
34+
- Delete pythonforandroid/recipes/cdecimal directory [\#2713](https://github.com/kivy/python-for-android/pull/2713) ([RobertFlatt](https://github.com/RobertFlatt))
35+
- Bump `sdl2` version to `2.26.1` [\#2712](https://github.com/kivy/python-for-android/pull/2712) ([misl6](https://github.com/misl6))
36+
- Flake8 does not support inline comments for any of the keys. [\#2708](https://github.com/kivy/python-for-android/pull/2708) ([misl6](https://github.com/misl6))
37+
- Gradle: Run the clean task before anything else to make sure nothing is cached. [\#2705](https://github.com/kivy/python-for-android/pull/2705) ([misl6](https://github.com/misl6))
38+
- Custom Service notification [\#2703](https://github.com/kivy/python-for-android/pull/2703) ([RobertFlatt](https://github.com/RobertFlatt))
39+
- Include paths for sdl2\_mixer have changed. Added a method to return the right one. [\#2700](https://github.com/kivy/python-for-android/pull/2700) ([misl6](https://github.com/misl6))
40+
- WRITE\_EXTERNAL\_STORAGE maxSdk [\#2694](https://github.com/kivy/python-for-android/pull/2694) ([RobertFlatt](https://github.com/RobertFlatt))
41+
- Fixes an issue regarding blacklist and bytecode compile + some cleanup [\#2693](https://github.com/kivy/python-for-android/pull/2693) ([misl6](https://github.com/misl6))
42+
- Bump to a version of `SDL` with patches for the TextInput / TextEditing \(SDL `2.26.0`\) [\#2692](https://github.com/kivy/python-for-android/pull/2692) ([misl6](https://github.com/misl6))
43+
- Make CI compile aiohttp again. [\#2690](https://github.com/kivy/python-for-android/pull/2690) ([xavierfiechter](https://github.com/xavierfiechter))
44+
- Add resources [\#2684](https://github.com/kivy/python-for-android/pull/2684) ([RobertFlatt](https://github.com/RobertFlatt))
45+
- Update `MIN_TARGET_API` to `30` and `RECOMMENDED_TARGET_API` to `33` [\#2683](https://github.com/kivy/python-for-android/pull/2683) ([misl6](https://github.com/misl6))
46+
- recipe.download\_file: implement shallow git cloning [\#2682](https://github.com/kivy/python-for-android/pull/2682) ([SomberNight](https://github.com/SomberNight))
47+
- requirements: relax version bound on "pep517" [\#2680](https://github.com/kivy/python-for-android/pull/2680) ([SomberNight](https://github.com/SomberNight))
48+
- Add new Android permissions [\#2677](https://github.com/kivy/python-for-android/pull/2677) ([RobertFlatt](https://github.com/RobertFlatt))
49+
- Resize webview when keyboard is shown [\#2674](https://github.com/kivy/python-for-android/pull/2674) ([dbnicholson](https://github.com/dbnicholson))
50+
- Update `SDL2`, `SDL2_ttf`, `SDL2_mixer`, `SDL2_image` to latest releases [\#2673](https://github.com/kivy/python-for-android/pull/2673) ([misl6](https://github.com/misl6))
51+
- Fixes libvpx build [\#2672](https://github.com/kivy/python-for-android/pull/2672) ([misl6](https://github.com/misl6))
52+
- `toml` may not be available on systemwide python [\#2670](https://github.com/kivy/python-for-android/pull/2670) ([misl6](https://github.com/misl6))
53+
- android/activity: Add Application.ActivityLifecycleCallbacks helpers [\#2669](https://github.com/kivy/python-for-android/pull/2669) ([dbnicholson](https://github.com/dbnicholson))
54+
- Bump minimal and recommended Android NDK version to 25b [\#2668](https://github.com/kivy/python-for-android/pull/2668) ([misl6](https://github.com/misl6))
55+
- Include HOME in build environment [\#2582](https://github.com/kivy/python-for-android/pull/2582) ([dbnicholson](https://github.com/dbnicholson))
56+
357
## [v2022.09.04](https://github.com/kivy/python-for-android/tree/v2022.09.04) (2022-09-04)
458

559
[Full Changelog](https://github.com/kivy/python-for-android/compare/v2022.07.20...v2022.09.04)

ci/constants.py

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class TargetPython(Enum):
1616
# build_dir = glob.glob('build/lib.*')[0]
1717
# IndexError: list index out of range
1818
'secp256k1',
19-
'ffpyplayer',
2019
# requires `libpq-dev` system dependency e.g. for `pg_config` binary
2120
'psycopg2',
2221
# most likely some setup in the Docker container, because it works in host

ci/makefiles/android.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Downloads and installs the Android SDK depending on supplied platform: darwin or linux
22

33
# Those android NDK/SDK variables can be override when running the file
4-
ANDROID_NDK_VERSION ?= 23b
4+
ANDROID_NDK_VERSION ?= 25b
55
ANDROID_NDK_VERSION_LEGACY ?= 21e
66
ANDROID_SDK_TOOLS_VERSION ?= 6514223
77
ANDROID_SDK_BUILD_TOOLS_VERSION ?= 29.0.3

doc/source/apis.rst

+45
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,51 @@ Example::
190190
# ...
191191

192192

193+
Activity lifecycle handling
194+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
195+
196+
.. module:: android.activity
197+
198+
The Android ``Application`` class provides the `ActivityLifecycleCallbacks
199+
<https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks>`_
200+
interface where callbacks can be registered corresponding to `activity
201+
lifecycle
202+
<https://developer.android.com/guide/components/activities/activity-lifecycle>`_
203+
changes. These callbacks can be used to implement logic in the Python app when
204+
the activity changes lifecycle states.
205+
206+
Note that some of the callbacks are not useful in the Python app. For example,
207+
an `onActivityCreated` callback will never be run since the the activity's
208+
`onCreate` callback will complete before the Python app is running. Similarly,
209+
saving instance state in an `onActivitySaveInstanceState` callback will not be
210+
helpful since the Python app doesn't have access to the restored instance
211+
state.
212+
213+
.. function:: register_activity_lifecycle_callbacks(callbackname=callback, ...)
214+
215+
This allows you to bind a callbacks to Activity lifecycle state changes.
216+
The callback names correspond to ``ActivityLifecycleCallbacks`` method
217+
names such as ``onActivityStarted``. See the `ActivityLifecycleCallbacks
218+
<https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks>`_
219+
documentation for names and function signatures for the callbacks.
220+
221+
.. function:: unregister_activity_lifecycle_callbacks(instance)
222+
223+
Unregister a ``ActivityLifecycleCallbacks`` instance previously registered
224+
with :func:`register_activity_lifecycle_callbacks`.
225+
226+
Example::
227+
228+
from android.activity import register_activity_lifecycle_callbacks
229+
230+
def on_activity_stopped(activity):
231+
print('Activity is stopping')
232+
233+
register_activity_lifecycle_callbacks(
234+
onActivityStopped=on_activity_stopped,
235+
)
236+
237+
193238
Receiving Broadcast message
194239
~~~~~~~~~~~~~~~~~~~~~~~~~~~
195240

doc/source/buildoptions.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,9 @@ options (this list may not be exhaustive):
8989
- ``--service``: A service name and the Python script it should
9090
run. See :ref:`arbitrary_scripts_services`.
9191
- ``--add-source``: Add a source directory to the app's Java code.
92-
- ``--no-compile-pyo``: Do not optimise .py files to .pyo.
92+
- ``--no-byte-compile-python``: Skip byte compile for .py files.
9393
- ``--enable-androidx``: Enable AndroidX support library.
94+
- ``--add-resource``: Put this file or directory in the apk res directory.
9495

9596

9697
webview

doc/source/launcher.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ grab an old (cached) package instead of a fresh one.
4848
.. warning::
4949

5050
Do not use any of `--private`, `--public`, `--dir` or other arguments for
51-
adding `main.py` or `main.pyo` to the app. The argument `--launcher` is
51+
adding `main.py` or `main.pyc` to the app. The argument `--launcher` is
5252
above them and tells the p4a to build the launcher version of the APK.
5353

5454
Usage

doc/source/quickstart.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ named ``tools``, and you will need to run extra commands to install
120120
the SDK packages needed.
121121

122122
For Android NDK, note that modern releases will only work on a 64-bit
123-
operating system. **The minimal, and recommended, NDK version to use is r23b:**
123+
operating system. **The minimal, and recommended, NDK version to use is r25b:**
124124

125125
- `Go to ndk downloads page <https://developer.android.com/ndk/downloads/>`_
126126
- Windows users should create a virtual machine with an GNU Linux os

doc/source/services.rst

+8
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ the json module to encode and decode more complex data.
107107

108108
from os import environ
109109
argument = environ.get('PYTHON_SERVICE_ARGUMENT', '')
110+
111+
To customize the notification icon, title, and text use three optional
112+
arguments to service.start()::
113+
114+
service.start(mActivity, 'small_icon', 'title', 'content' , argument)
115+
116+
Where 'small_icon' is the name of an Android drawable or mipmap resource,
117+
and 'title' and 'content' are strings in the notification.
110118

111119
Services support a range of options and interactions not yet
112120
documented here but all accessible via calling other methods of the

pythonforandroid/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '2022.09.04'
1+
__version__ = '2022.12.20'

pythonforandroid/archs.py

+12
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ def get_clang_exe(self, with_target=False, plus_plus=False):
109109
def get_env(self, with_flags_in_cc=True):
110110
env = {}
111111

112+
# HOME: User's home directory
113+
#
114+
# Many tools including p4a store outputs in the user's home
115+
# directory. This is found from the HOME environment variable
116+
# and falls back to the system account database. Setting HOME
117+
# can be used to globally divert these tools to use a different
118+
# path. Furthermore, in containerized environments the user may
119+
# not exist in the account database, so if HOME isn't set than
120+
# these tools will fail.
121+
if 'HOME' in environ:
122+
env['HOME'] = environ['HOME']
123+
112124
# CFLAGS/CXXFLAGS: the processor flags
113125
env['CFLAGS'] = ' '.join(self.common_cflags).format(target=self.target)
114126
if self.arch_cflags:

pythonforandroid/bdistapk.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def prepare_build_dir(self):
108108
makedirs(new_dir)
109109
print('Including {}'.format(filen))
110110
copyfile(filen, join(bdist_dir, filen))
111-
if basename(filen) in ('main.py', 'main.pyo'):
111+
if basename(filen) in ('main.py', 'main.pyc'):
112112
main_py_dirs.append(filen)
113113

114114
# This feels ridiculous, but how else to define the main.py dir?

0 commit comments

Comments
 (0)