Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion doc/source/services.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ python-for-android creates for each one, as follows::
service.start(mActivity, argument)

Here, ``your.package.domain.package.name`` refers to the package identifier
of your APK.
of your APK.

If you are using buildozer, the identifier is set by the ``package.name``
and ``package.domain`` values in your buildozer.spec file.
Expand All @@ -89,6 +89,15 @@ argument, but with the first letter upper case. You must also pass the
``argument`` parameter even if (as here) it is an empty string. If you
do pass it, the service can make use of this argument.

The service argument is made available to your service via the
'PYTHON_SERVICE_ARGUMENT' environment variable. It is exposed as a simple
string, so if you want to pass in multiple values, we would recommend using
the json module to encode and decode mode complex data.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"more complex data" instead of "mode complex data"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in #1423

::

from os import environ
argument = environ.get('PYTHON_SERVICE_ARGUMENT', '')

Services support a range of options and interactions not yet
documented here but all accessible via calling other methods of the
``service`` reference.
Expand Down