diff --git a/docs/source/android.rst b/docs/source/android.rst index f6c852212e..98ca12ac9b 100644 --- a/docs/source/android.rst +++ b/docs/source/android.rst @@ -1,12 +1,11 @@ Python API ========== -Python for android project include a "android" python module. The module is -composed of multiple part, mostly done for a easier usage of Java API. The -module is not designed to wrap anything you want. +The Python for android project includes a Python module called "android". It +consists of multiple parts which are mostly there to facilitate the use of the Java API. -Most of the Java API is accessible with PyJNIus, and then. prefer to see if you -can use Java API directly first. +This module is not designed to be comprehensive. Most of the Java API is also accessible with PyJNIus, +so if you can't find what you need here you can try using the Java API directly instead. Android (``android``) @@ -17,18 +16,18 @@ Android (``android``) .. function:: check_pause() This should be called on a regular basis to check to see if Android - expects the game to pause. If it return true, the game should call - :func:`android.wait_for_resume()`, after persisting its state as necessary. + expects the application to pause. If it returns true, the app should call + :func:`android.wait_for_resume()`, after storing its state as necessary. .. function:: wait_for_resume() - This function should be called after :func:`android.check_pause()` returns + This function should be called after :func:`android.check_pause()` and returns true. It does not return until Android has resumed from the pause. While in - this function, Android may kill a game without further notice. + this function, Android may kill the app without further notice. .. function:: map_key(keycode, keysym) - This maps between an android keycode and a python keysym. The android + This maps an android keycode to a python keysym. The android keycodes are available as constants in the android module. @@ -37,7 +36,7 @@ Activity (``android.activity``) .. module:: android.activity -The default PythonActivity have a observer pattern for `onActivityResult `_ and `onNewIntent `_. +The default PythonActivity has a observer pattern for `onActivityResult `_ and `onNewIntent `_. .. function:: bind(eventname=callback, ...) @@ -51,8 +50,7 @@ The default PythonActivity have a observer pattern for `onActivityResult `_: +This billing module gives an access to the `In-App Billing `_: -#. `Setup a test accounts `_, and get your Public Key +#. `Setup a test account `_, and get your Public Key #. Export your public key:: export BILLING_PUBKEY="Your public key here" @@ -104,18 +102,18 @@ This billing module give an access to the `In-App Billing `_ module, you don't have to do -anything, all is automatic. +anything, it is all automatic. The `android.mixer` module is a wrapper around the Android MediaPlayer class. This allows it to take advantage of any hardware acceleration present, and also eliminates the need to ship codecs as part of an application. -It has several differences from the pygame mixer: +It has several differences with the pygame mixer: -* The init and pre_init methods work, but are ignored - Android chooses - appropriate setting automatically. +* The init() and pre_init() methods work, but are ignored - Android chooses + appropriate settings automatically. * Only filenames and true file objects can be used - file-like objects will probably not work. * Fadeout does not work - it causes a stop to occur. -* Looping is all or nothing, there's no way to choose the number of +* Looping is all or nothing, there is no way to choose the number of loops that occur. For looping to work, the :func:`android.mixer.periodic` function should be called on a regular basis. @@ -304,13 +302,13 @@ This can be used to prevent errors like: Service (``android.service``) ----------------------------- -Service part of the application is controlled through the class :class:`AndroidService`. +Services of an application are controlled through the class :class:`AndroidService`. .. module:: android.service .. class:: AndroidService(title, description) - Run ``service/main.py`` from application directory as a service. + Run ``service/main.py`` from the application directory as a service. :param title: Notification title, default to 'Python service' :param description: Notification text, default to 'Kivy Python service started' @@ -321,8 +319,8 @@ Service part of the application is controlled through the class :class:`AndroidS Start the service. - :param arg: Argument to pass to a service, through environment variable - ``PYTHON_SERVICE_ARGUMENT``, default to '' + :param arg: Argument to pass to a service, through the environment variable + ``PYTHON_SERVICE_ARGUMENT``. Defaults to '' :type arg: str .. method:: stop() @@ -359,7 +357,7 @@ Application service part example, ``service/main.py``: arg = os.getenv('PYTHON_SERVICE_ARGUMENT') while True: - # this will print 'Hello From Service' continually, even when application is switched + # this will print 'Hello From Service' continually, even when the application is switched print arg time.sleep(1)