@@ -68,15 +68,23 @@ code), you must use PyJNIus to interact with the java class
68
68
python-for-android creates for each one, as follows::
69
69
70
70
from jnius import autoclass
71
- service = autoclass('your.package.name.ServiceMyservice')
71
+ service = autoclass('your.package.domain.package. name.ServiceMyservice')
72
72
mActivity = autoclass('org.kivy.android.PythonActivity').mActivity
73
73
argument = ''
74
74
service.start(mActivity, argument)
75
75
76
- Here, ``your.package.name `` refers to the package identifier of your
77
- APK as set by the ``--package `` argument to python-for-android, and
78
- the name of the service is ``ServiceMyservice ``, in which ``Myservice ``
79
- is the identifier that was previously passed to the ``--service ``
76
+ Here, ``your.package.domain.package.name `` refers to the package identifier
77
+ of your APK.
78
+
79
+ If you are using buildozer, the identifier is set by the ``package.name ``
80
+ and ``package.domain `` values in your buildozer.spec file.
81
+ The name of the service is ``ServiceMyservice ``, where ``Myservice ``
82
+ is the name specied by one of the ``services `` values, but with the first
83
+ letter upper case.
84
+
85
+ If you are using python-for-android directly, the identifier is set by the ``--package ``
86
+ argument to python-for-android. The name of the service is ``ServiceMyservice ``,
87
+ where ``Myservice `` is the identifier that was previously passed to the ``--service ``
80
88
argument, but with the first letter upper case. You must also pass the
81
89
``argument `` parameter even if (as here) it is an empty string. If you
82
90
do pass it, the service can make use of this argument.
0 commit comments