Skip to content

Commit

Permalink
Merge pull request #2718 from kivy/release-2022.12.20
Browse files Browse the repository at this point in the history
Release 2022.12.20
  • Loading branch information
misl6 authored Dec 24, 2022
2 parents c1ec69c + 697929b commit cc6481b
Show file tree
Hide file tree
Showing 60 changed files with 740 additions and 523 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,11 @@ jobs:
target: testapps-with-numpy
- name: webview
target: testapps-webview
include:
- runs_on: macos-latest
ndk_version: '23b'
- runs_on: apple-silicon-m1
ndk_version: '24'
env:
ANDROID_HOME: ${HOME}/.android
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
ANDROID_NDK_VERSION: ${{ matrix.ndk_version }}
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
Expand Down Expand Up @@ -247,17 +241,11 @@ jobs:
target: testapps-with-numpy-aab
- name: webview
target: testapps-webview-aab
include:
- runs_on: macos-latest
ndk_version: '23b'
- runs_on: apple-silicon-m1
ndk_version: '24'
env:
ANDROID_HOME: ${HOME}/.android
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
ANDROID_NDK_VERSION: ${{ matrix.ndk_version }}
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
Expand Down Expand Up @@ -330,18 +318,12 @@ jobs:
matrix:
android_arch: ["arm64-v8a", "armeabi-v7a", "x86_64", "x86"]
runs_on: [macos-latest, apple-silicon-m1]
include:
- runs_on: macos-latest
ndk_version: '23b'
- runs_on: apple-silicon-m1
ndk_version: '24'
env:
ANDROID_HOME: ${HOME}/.android
ANDROID_SDK_ROOT: ${HOME}/.android/android-sdk
ANDROID_SDK_HOME: ${HOME}/.android/android-sdk
ANDROID_NDK_HOME: ${HOME}/.android/android-ndk
REBUILD_UPDATED_RECIPES_EXTRA_ARGS: --arch=${{ matrix.android_arch }}
ANDROID_NDK_VERSION: ${{ matrix.ndk_version }}
steps:
- name: Checkout python-for-android
uses: actions/checkout@v2
Expand Down
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,59 @@
# Changelog

## [v2022.12.20](https://github.com/kivy/python-for-android/tree/v2022.12.20) (2022-12-20)

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

**Fixed bugs:**

- `liblzma` fails to build on macOS \(sh.ErrorReturnCode\_2. when running buildozer android debug\) [\#2343](https://github.com/kivy/python-for-android/issues/2343)

**Closed issues:**

- SDL\_ttf 2.0.15 download missing \(deprecated\) related to \#2698 [\#2710](https://github.com/kivy/python-for-android/issues/2710)
- Update kivy app that's already published on google play store. [\#2709](https://github.com/kivy/python-for-android/issues/2709)
- Installing deepspeech [\#2702](https://github.com/kivy/python-for-android/issues/2702)
- ImportError: dlopen failed: library "libc++\_shared.so" not found [\#2699](https://github.com/kivy/python-for-android/issues/2699)
- ffpyplayer recipe broken after SDL2 upgrade [\#2698](https://github.com/kivy/python-for-android/issues/2698)
- ModuleNotFoundError: No module named 'android' [\#2697](https://github.com/kivy/python-for-android/issues/2697)
- Error When I set android.api = 31 [\#2696](https://github.com/kivy/python-for-android/issues/2696)
- Is threre any way to protect .py code [\#2695](https://github.com/kivy/python-for-android/issues/2695)
- args.service\_class\_name results in link error [\#2679](https://github.com/kivy/python-for-android/issues/2679)
- Remove `x86_64` suffix from ndk download link [\#2676](https://github.com/kivy/python-for-android/issues/2676)
- Pillow 9.2.0 recipe? [\#2671](https://github.com/kivy/python-for-android/issues/2671)
- `ffmpeg`: unable to find library -lvpx [\#2665](https://github.com/kivy/python-for-android/issues/2665)
- Buildozer fails while build numpy recipie 'UnixCCompiler' object has no attribute 'cxx\_compiler' [\#2664](https://github.com/kivy/python-for-android/issues/2664)
- \[PEP 517\] Relax installation-time "pep517\<0.7.0" requirement [\#2573](https://github.com/kivy/python-for-android/issues/2573)
- Add support for custom resources [\#2298](https://github.com/kivy/python-for-android/issues/2298)
- Auto-correct / word suggestion does not work with Swiftkey/Samsung keyboard [\#2010](https://github.com/kivy/python-for-android/issues/2010)

**Merged pull requests:**

- `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))
- secp256k1 Update "--host=" [\#2714](https://github.com/kivy/python-for-android/pull/2714) ([RobertFlatt](https://github.com/RobertFlatt))
- Delete pythonforandroid/recipes/cdecimal directory [\#2713](https://github.com/kivy/python-for-android/pull/2713) ([RobertFlatt](https://github.com/RobertFlatt))
- Bump `sdl2` version to `2.26.1` [\#2712](https://github.com/kivy/python-for-android/pull/2712) ([misl6](https://github.com/misl6))
- 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))
- 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))
- Custom Service notification [\#2703](https://github.com/kivy/python-for-android/pull/2703) ([RobertFlatt](https://github.com/RobertFlatt))
- 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))
- WRITE\_EXTERNAL\_STORAGE maxSdk [\#2694](https://github.com/kivy/python-for-android/pull/2694) ([RobertFlatt](https://github.com/RobertFlatt))
- 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))
- 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))
- Make CI compile aiohttp again. [\#2690](https://github.com/kivy/python-for-android/pull/2690) ([xavierfiechter](https://github.com/xavierfiechter))
- Add resources [\#2684](https://github.com/kivy/python-for-android/pull/2684) ([RobertFlatt](https://github.com/RobertFlatt))
- 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))
- recipe.download\_file: implement shallow git cloning [\#2682](https://github.com/kivy/python-for-android/pull/2682) ([SomberNight](https://github.com/SomberNight))
- requirements: relax version bound on "pep517" [\#2680](https://github.com/kivy/python-for-android/pull/2680) ([SomberNight](https://github.com/SomberNight))
- Add new Android permissions [\#2677](https://github.com/kivy/python-for-android/pull/2677) ([RobertFlatt](https://github.com/RobertFlatt))
- Resize webview when keyboard is shown [\#2674](https://github.com/kivy/python-for-android/pull/2674) ([dbnicholson](https://github.com/dbnicholson))
- 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))
- Fixes libvpx build [\#2672](https://github.com/kivy/python-for-android/pull/2672) ([misl6](https://github.com/misl6))
- `toml` may not be available on systemwide python [\#2670](https://github.com/kivy/python-for-android/pull/2670) ([misl6](https://github.com/misl6))
- android/activity: Add Application.ActivityLifecycleCallbacks helpers [\#2669](https://github.com/kivy/python-for-android/pull/2669) ([dbnicholson](https://github.com/dbnicholson))
- Bump minimal and recommended Android NDK version to 25b [\#2668](https://github.com/kivy/python-for-android/pull/2668) ([misl6](https://github.com/misl6))
- Include HOME in build environment [\#2582](https://github.com/kivy/python-for-android/pull/2582) ([dbnicholson](https://github.com/dbnicholson))

## [v2022.09.04](https://github.com/kivy/python-for-android/tree/v2022.09.04) (2022-09-04)

[Full Changelog](https://github.com/kivy/python-for-android/compare/v2022.07.20...v2022.09.04)
Expand Down
1 change: 0 additions & 1 deletion ci/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class TargetPython(Enum):
# build_dir = glob.glob('build/lib.*')[0]
# IndexError: list index out of range
'secp256k1',
'ffpyplayer',
# requires `libpq-dev` system dependency e.g. for `pg_config` binary
'psycopg2',
# most likely some setup in the Docker container, because it works in host
Expand Down
2 changes: 1 addition & 1 deletion ci/makefiles/android.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Downloads and installs the Android SDK depending on supplied platform: darwin or linux

# Those android NDK/SDK variables can be override when running the file
ANDROID_NDK_VERSION ?= 23b
ANDROID_NDK_VERSION ?= 25b
ANDROID_NDK_VERSION_LEGACY ?= 21e
ANDROID_SDK_TOOLS_VERSION ?= 6514223
ANDROID_SDK_BUILD_TOOLS_VERSION ?= 29.0.3
Expand Down
45 changes: 45 additions & 0 deletions doc/source/apis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,51 @@ Example::
# ...


Activity lifecycle handling
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. module:: android.activity

The Android ``Application`` class provides the `ActivityLifecycleCallbacks
<https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks>`_
interface where callbacks can be registered corresponding to `activity
lifecycle
<https://developer.android.com/guide/components/activities/activity-lifecycle>`_
changes. These callbacks can be used to implement logic in the Python app when
the activity changes lifecycle states.

Note that some of the callbacks are not useful in the Python app. For example,
an `onActivityCreated` callback will never be run since the the activity's
`onCreate` callback will complete before the Python app is running. Similarly,
saving instance state in an `onActivitySaveInstanceState` callback will not be
helpful since the Python app doesn't have access to the restored instance
state.

.. function:: register_activity_lifecycle_callbacks(callbackname=callback, ...)

This allows you to bind a callbacks to Activity lifecycle state changes.
The callback names correspond to ``ActivityLifecycleCallbacks`` method
names such as ``onActivityStarted``. See the `ActivityLifecycleCallbacks
<https://developer.android.com/reference/android/app/Application.ActivityLifecycleCallbacks>`_
documentation for names and function signatures for the callbacks.

.. function:: unregister_activity_lifecycle_callbacks(instance)

Unregister a ``ActivityLifecycleCallbacks`` instance previously registered
with :func:`register_activity_lifecycle_callbacks`.

Example::

from android.activity import register_activity_lifecycle_callbacks

def on_activity_stopped(activity):
print('Activity is stopping')

register_activity_lifecycle_callbacks(
onActivityStopped=on_activity_stopped,
)


Receiving Broadcast message
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
3 changes: 2 additions & 1 deletion doc/source/buildoptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ options (this list may not be exhaustive):
- ``--service``: A service name and the Python script it should
run. See :ref:`arbitrary_scripts_services`.
- ``--add-source``: Add a source directory to the app's Java code.
- ``--no-compile-pyo``: Do not optimise .py files to .pyo.
- ``--no-byte-compile-python``: Skip byte compile for .py files.
- ``--enable-androidx``: Enable AndroidX support library.
- ``--add-resource``: Put this file or directory in the apk res directory.


webview
Expand Down
2 changes: 1 addition & 1 deletion doc/source/launcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ grab an old (cached) package instead of a fresh one.
.. warning::

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

Usage
Expand Down
2 changes: 1 addition & 1 deletion doc/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ named ``tools``, and you will need to run extra commands to install
the SDK packages needed.

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

- `Go to ndk downloads page <https://developer.android.com/ndk/downloads/>`_
- Windows users should create a virtual machine with an GNU Linux os
Expand Down
8 changes: 8 additions & 0 deletions doc/source/services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ the json module to encode and decode more complex data.

from os import environ
argument = environ.get('PYTHON_SERVICE_ARGUMENT', '')
To customize the notification icon, title, and text use three optional
arguments to service.start()::

service.start(mActivity, 'small_icon', 'title', 'content' , argument)

Where 'small_icon' is the name of an Android drawable or mipmap resource,
and 'title' and 'content' are strings in the notification.

Services support a range of options and interactions not yet
documented here but all accessible via calling other methods of the
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2022.09.04'
__version__ = '2022.12.20'
12 changes: 12 additions & 0 deletions pythonforandroid/archs.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ def get_clang_exe(self, with_target=False, plus_plus=False):
def get_env(self, with_flags_in_cc=True):
env = {}

# HOME: User's home directory
#
# Many tools including p4a store outputs in the user's home
# directory. This is found from the HOME environment variable
# and falls back to the system account database. Setting HOME
# can be used to globally divert these tools to use a different
# path. Furthermore, in containerized environments the user may
# not exist in the account database, so if HOME isn't set than
# these tools will fail.
if 'HOME' in environ:
env['HOME'] = environ['HOME']

# CFLAGS/CXXFLAGS: the processor flags
env['CFLAGS'] = ' '.join(self.common_cflags).format(target=self.target)
if self.arch_cflags:
Expand Down
2 changes: 1 addition & 1 deletion pythonforandroid/bdistapk.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def prepare_build_dir(self):
makedirs(new_dir)
print('Including {}'.format(filen))
copyfile(filen, join(bdist_dir, filen))
if basename(filen) in ('main.py', 'main.pyo'):
if basename(filen) in ('main.py', 'main.pyc'):
main_py_dirs.append(filen)

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

0 comments on commit cc6481b

Please sign in to comment.