Skip to content

Commit 03f3321

Browse files
committed
Merge pull request kivy#303 from mivade/master
Documentation grammar and spelling fixes
2 parents ea42975 + 1321842 commit 03f3321

8 files changed

+93
-77
lines changed

docs/source/android.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
Python API
22
==========
33

4-
The Python for android project includes a Python module called "android". It
5-
consists of multiple parts which are mostly there to facilitate the use of the Java API.
4+
The Python for Android project includes a Python module called
5+
``android`` which consists of multiple parts that are mostly there to
6+
facilitate the use of the Java API.
67

7-
This module is not designed to be comprehensive. Most of the Java API is also accessible with PyJNIus,
8-
so if you can't find what you need here you can try using the Java API directly instead.
8+
This module is not designed to be comprehensive. Most of the Java API
9+
is also accessible with PyJNIus, so if you can't find what you need
10+
here you can try using the Java API directly instead.
911

1012

1113
Android (``android``)
@@ -88,7 +90,7 @@ This billing module gives an access to the `In-App Billing <http://developer.and
8890

8991
#. `Setup some In-App product <http://developer.android.com/guide/google/play/billing/billing_admin.html>`_ to buy. Let's say you've created a product with the id "org.kivy.gopremium"
9092

91-
#. In your application, you can use the billing module like this::
93+
#. In your application, you can use the ``billing`` module like this::
9294

9395

9496
from android.billing import BillingService
@@ -123,7 +125,7 @@ This billing module gives an access to the `In-App Billing <http://developer.and
123125
# Return all the items purchased
124126
return self.service.get_purchased_items()
125127

126-
#. To initiate an in-app purchase, just call the buy() method::
128+
#. To initiate an in-app purchase, just call the ``buy()`` method::
127129

128130
# Note: start the service at the start, and never twice!
129131
bs = MyBillingService()
@@ -136,7 +138,7 @@ This billing module gives an access to the `In-App Billing <http://developer.and
136138

137139
#. You'll receive all the notifications about the billing process in the callback.
138140

139-
#. Last step, create your application with `--with-billing $BILLING_PUBKEY`::
141+
#. Last step, create your application with ``--with-billing $BILLING_PUBKEY``::
140142

141143
./build.py ... --with-billing $BILLING_PUBKEY
142144

docs/source/contribute.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ Extending Python for android native support
55
-------------------------------------------
66

77
So, you want to get into python-for-android and extend what's available
8-
to python on android ?
8+
to Python on Android ?
99

1010
Turns out it's not very complicated, here is a little introduction on how to go
11-
about it. Without Pyjnius, the schema to access to Java API from Cython is::
11+
about it. Without Pyjnius, the schema to access the Java API from Cython is::
1212

1313
[1] Cython -> [2] C JNI -> [3] Java
1414

15-
Think about acceleration sensors : you want to get the acceleration values in
16-
python nothing is available natively, but you have a java API for that : the
17-
google API is available here
15+
Think about acceleration sensors: you want to get the acceleration
16+
values in Python, but nothing is available natively. Lukcily you have
17+
a Java API for that : the Google API is available here
1818
http://developer.android.com/reference/android/hardware/Sensor.html
1919

2020
You can't use it directly, you need to do your own API to use it in python,
@@ -82,14 +82,14 @@ Jni gottchas
8282
Create your own recipes
8383
-----------------------
8484

85-
A recipe is a script that contain the "definition" of a module to compile.
85+
A recipe is a script that contains the "definition" of a module to compile.
8686
The directory layout of a recipe for a <modulename> is something like::
8787

8888
python-for-android/recipes/<modulename>/recipe.sh
8989
python-for-android/recipes/<modulename>/patches/
9090
python-for-android/recipes/<modulename>/patches/fix-path.patch
9191

92-
When building, all the recipe build must go to::
92+
When building, all the recipe builds must go to::
9393

9494
python-for-android/build/<modulename>/<archiveroot>
9595

@@ -101,5 +101,5 @@ For example, if you want to create a recipe for sdl, do::
101101
sed -i 's#XXX#sdl#' sdl/recipe.sh
102102

103103
Then, edit the sdl/recipe.sh to adjust other information (version, url) and
104-
complete build function.
104+
complete the build function.
105105

docs/source/example_helloworld.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ with this project.
77

88
.. note::
99

10-
Don't forget that Python for android is not Kivy only, and you might want
11-
to use other toolkit libraries. When other toolkits will be available, this
12-
documentation will be enhanced.
10+
Don't forget that Python for Android is not Kivy only, and you
11+
might want to use other toolkit libraries. When other toolkits
12+
will be available, this documentation will be enhanced.
1313

1414
Let's create a simple Hello world application, with one Label and one Button.
1515

@@ -55,15 +55,16 @@ Let's create a simple Hello world application, with one Label and one Button.
5555

5656
#. Go to the ``python-for-android`` directory
5757

58-
#. Create a distribute with kivy::
58+
#. Create a distribution with kivy::
5959

6060
./distribute.sh -m kivy
6161

6262
#. Go to the newly created ``default`` distribution::
6363

6464
cd dist/default
6565

66-
#. Plug your android device, and ensure you can install development application
66+
#. Plug your android device, and ensure you can install development
67+
application
6768

6869
#. Build your hello world application in debug mode::
6970

@@ -72,7 +73,7 @@ Let's create a simple Hello world application, with one Label and one Button.
7273

7374
#. Take your device, and start the application!
7475

75-
#. If it's goes wrong, open the logcat by doing::
76+
#. If something goes wrong, open the logcat by doing::
7677

7778
adb logcat
7879

docs/source/examples.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Examples
44
Prebuilt VirtualBox
55
-------------------
66

7-
A good starting point to build an APK are prebuilt VirtualBox images, where
8-
the Android NDK, the Android SDK and the Kivy Python-For-Android sources
9-
are prebuilt in an VirtualBox image. Please search the `Download Section
10-
<http://kivy.org/#download>`__ for
11-
such an image. You will also need to create a device filter for the Android
7+
A good starting point to build an APK are prebuilt VirtualBox images,
8+
where the Android NDK, the Android SDK, and the Kivy
9+
Python-For-Android sources are prebuilt in an VirtualBox image. Please
10+
search the `Download Section <http://kivy.org/#download>`__ for such
11+
an image. You will also need to create a device filter for the Android
1212
USB device using the VirtualBox OS settings.
1313

1414
.. include:: example_helloworld.rst

docs/source/faq.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ Android. Go to :doc:`prerequisites.rst` to see which one are working.
1010
_sqlite3.so not found
1111
---------------------
1212

13-
We recently fixed sqlite3 compilation. In case of, you must:
13+
We recently fixed sqlite3 compilation. In case of this error, you
14+
must:
1415

15-
* Install development headers for sqlite3 if it's not already installed. On Ubuntu:
16+
* Install development headers for sqlite3 if they are not already
17+
installed. On Ubuntu:
1618

1719
apt-get install libsqlite3-dev
1820

@@ -26,4 +28,4 @@ We recently fixed sqlite3 compilation. In case of, you must:
2628
sqlite3/*
2729
lib-dynload/_sqlite3.so
2830

29-
And then, sqlite3 will be compiled, and included in your APK.
31+
Then sqlite3 will be compiled and included in your APK.

docs/source/javaapi.rst

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ Using `PyJNIus <https://github.com/kivy/pyjnius>`__ to access the Android API
55
restricts the usage to a simple call of the **autoclass** constructor function
66
and a second call to instantiate this class.
77

8-
You can access through this method all Java Android API, e.g. to get the DisplayMetrics
9-
of an Android device could fetched using the following piece of code:
8+
You can access through this method the entire Java Android API, e.g.,
9+
the ``DisplayMetrics`` of an Android device could be fetched using the
10+
following piece of code:
1011

1112
.. code-block:: python
1213
@@ -15,17 +16,18 @@ of an Android device could fetched using the following piece of code:
1516
metrics.setToDefaults()
1617
self.densityDpi = metrics.densityDpi
1718
18-
You can access all fields and methods as described in the `Java Android
19-
DisplayMetrics API <http://developer.android.com/reference/android/util/DisplayMetrics.html>`__
20-
as shown here with the method `setToDefaults()` and the field `densityDpi`.
21-
Before you use o view a field, you should always call `setToDefaults` to initiate
22-
to the default values of the device.
23-
24-
Currently only JavaMethod, JavaStaticMethod, JavaField, JavaStaticField
25-
and JavaMultipleMethod are built into PyJNIus, therefore such constructs like
26-
registerListener or something like this have to be coded still in Java.
27-
For this the Android module described below is available to access some of
28-
the hardware in Android devices.
19+
You can access all fields and methods as described in the `Java
20+
Android DisplayMetrics API
21+
<http://developer.android.com/reference/android/util/DisplayMetrics.html>`__
22+
as shown here with the method `setToDefaults()` and the field
23+
`densityDpi`. Before you use a view field, you should always call
24+
`setToDefaults` to initiate to the default values of the device.
25+
26+
Currently only JavaMethod, JavaStaticMethod, JavaField,
27+
JavaStaticField and JavaMultipleMethod are built into PyJNIus,
28+
therefore such constructs like registerListener or something like this
29+
must still be coded in Java. For this the Android module described
30+
below is available to access some of the hardware on Android devices.
2931

3032
.. module:: org.renpy.android
3133

docs/source/prerequisites.rst

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
Prerequisites
22
-------------
33

4-
.. note::
5-
There is a VirtualBox Image we provide with the prerequisites along with
6-
Android SDK and NDK preinstalled to ease your installation woes. You can download it from `here <http://kivy.org/#download>`__.
4+
.. note:: There is a VirtualBox Image we provide with the
5+
prerequisites along with the Android SDK and NDK preinstalled to
6+
ease your installation woes. You can download it from `here
7+
<http://kivy.org/#download>`__.
78

89
.. warning::
910

10-
The current version is tested only on Ubuntu oneiric (11.10) and precise
11-
(12.04). If it doesn't work on other platforms, send us patch, not bug
12-
report. Pyhton for Android works on Linux and Mac OSX, not Windows.
11+
The current version is tested only on Ubuntu oneiric (11.10) and
12+
precise (12.04). If it doesn't work on other platforms, send us a
13+
patch, not a bug report. Python for Android works on Linux and Mac
14+
OS X, not Windows.
1315

14-
You need the minimal environment for building python. Note that other libraries
15-
might need other tools (cython is used by some recipes, and ccache to speedup the build)::
16+
You need the minimal environment for building python. Note that other
17+
libraries might need other tools (cython is used by some recipes, and
18+
ccache to speedup the build)::
1619

1720
sudo apt-get install build-essential patch git-core ccache ant python-pip python-dev
1821

@@ -24,12 +27,13 @@ On debian Squeeze amd64, those packages were found to be necessary ::
2427

2528
sudo apt-get install lib32stdc++6 lib32z1
2629

27-
Ensure you have the latest cython version::
30+
Ensure you have the latest Cython version::
2831

2932
pip install --upgrade cython
3033

31-
You must have android SDK and NDK. The SDK defines the Android functions you can use.
32-
The NDK is used for compilation. Right now, it's prefered to use:
34+
You must have android SDK and NDK. The SDK defines the Android
35+
functions you can use. The NDK is used for compilation. Right now,
36+
it's preferred to use:
3337

3438
- SDK API 8 or 14 (15 will only work with a newly released NDK)
3539
- NDK r5b or r7
@@ -42,8 +46,8 @@ You can download them at::
4246

4347
In general, Python for Android currently works with Android 2.3 to L.
4448

45-
If it's your very first time into android SDK, don't forget to follow
46-
documentation for recommended components at::
49+
If it's your very first time using the Android SDK, don't forget to
50+
follow the documentation for recommended components at::
4751

4852
http://developer.android.com/sdk/installing/adding-packages.html
4953

@@ -55,7 +59,8 @@ documentation for recommended components at::
5559
well, so that you can test your application on the full range of
5660
Android platform versions that your application supports.
5761

58-
After installing them, export both installation path, NDK version and API to use::
62+
After installing them, export both installation paths, NDK version,
63+
and API to use::
5964

6065
export ANDROIDSDK=/path/to/android-sdk
6166
export ANDROIDNDK=/path/to/android-ndk
@@ -68,7 +73,7 @@ After installing them, export both installation path, NDK version and API to use
6873
export ANDROIDNDKVER=r7
6974
export ANDROIDAPI=14
7075

71-
Also, you must configure you're PATH to add the ``android`` binary::
76+
Also, you must configure your PATH to add the ``android`` binary::
7277

7378
export PATH=$ANDROIDNDK:$ANDROIDSDK/platform-tools:$ANDROIDSDK/tools:$PATH
7479

docs/source/usage.rst

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ Usage
44
Step 1: compile the toolchain
55
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66

7-
If you want to compile the toolchain with only kivy module::
7+
If you want to compile the toolchain with only the kivy module::
88

99
./distribute.sh -m "kivy"
1010

11-
After a long time, you'll get a "dist/default" directory containing all the compiled
12-
libraries and build.py script to package your application using thoses
13-
libraries.
11+
After a long time, you'll get a "dist/default" directory containing
12+
all the compiled libraries and a build.py script to package your
13+
application using thoses libraries.
1414

1515
You can include other modules (or "recipes") to compile using `-m`::
1616

@@ -23,27 +23,31 @@ You can include other modules (or "recipes") to compile using `-m`::
2323
The list of recipes we currently have is at:
2424
https://github.com/kivy/python-for-android/tree/master/recipes
2525

26-
You can also specify a specific version for each package. Please note that the
27-
compilation might **break** if you don't use the default version. Most recipes
28-
have patch to fixes android issues, and might not apply if you specify a
29-
version. We also recommend to clean build/ before changing version.::
26+
You can also specify a specific version for each package. Please note
27+
that the compilation might **break** if you don't use the default
28+
version. Most recipes have patches to fix Android issues, and might
29+
not apply if you specify a version. We also recommend to clean build
30+
before changing version.::
3031

3132
./distribute.sh -m "openssl kivy==master"
3233

33-
Python modules that don't need C extrnsions don't need a recipe and can be included this way.
34-
From python-for-android 1.1 on, you can now specify pure-python package into the
35-
distribution. It will use virtualenv and pip to install pure-python modules into the
36-
distribution. Please note that compiler are deactivated, and will break any
37-
module who try to compile something. If compilation is needed, write a recipe::
34+
Python modules that don't need C extrnsions don't need a recipe and
35+
can be included this way. From python-for-android 1.1 on, you can now
36+
specify pure-python package into the distribution. It will use
37+
virtualenv and pip to install pure-python modules into the
38+
distribution. Please note that the compiler is deactivated, and will
39+
break any module which tries to compile something. If compilation is
40+
needed, write a recipe::
3841

3942
./distribute.sh -m "requests pygments kivy"
4043

4144
.. note::
4245

4346
Recipes download a defined version of their needed package from the
44-
internet, and build from it, if you know what you are doing, and want to
45-
override that, you can export the env variable `P4A_recipe_name_DIR` and
46-
this directory will be copied and used instead.
47+
internet, and build from it. If you know what you are doing, and
48+
want to override that, you can export the env variable
49+
`P4A_recipe_name_DIR` and this directory will be copied and used
50+
instead.
4751

4852
Available options to `distribute.sh`::
4953

@@ -57,7 +61,7 @@ Available options to `distribute.sh`::
5761
Step 2: package your application
5862
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5963

60-
Go fo your custom python distribution::
64+
Go to your custom Python distribution::
6165

6266
cd dist/default
6367

@@ -66,16 +70,16 @@ Use the build.py for creating the APK::
6670
./build.py --package org.test.touchtracer --name touchtracer \
6771
--version 1.0 --dir ~/code/kivy/examples/demo/touchtracer debug
6872

69-
Then, the android package (APK) will be generated at:
73+
Then, the Android package (APK) will be generated at:
7074

7175
bin/touchtracer-1.0-debug.apk
7276

7377
.. warning::
7478

7579
Some files and modules for python are blacklisted by default to
76-
save a few megabytes on the final apk file, in case your
80+
save a few megabytes on the final APK file. In case your
7781
applications doesn't find a standard python module, check the
78-
src/blacklist.txt file remove the module you need from the list,
82+
src/blacklist.txt file, remove the module you need from the list,
7983
and try again.
8084

8185
Available options to `build.py`::

0 commit comments

Comments
 (0)