From 800234b8268998f547ffb3e02fe8e432cfbe94c0 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Sun, 27 Jul 2014 16:54:31 +0100 Subject: [PATCH] Added android api doc page --- doc/sources/guide/api-android.rst | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 doc/sources/guide/api-android.rst diff --git a/doc/sources/guide/api-android.rst b/doc/sources/guide/api-android.rst new file mode 100644 index 000000000..64e52927e --- /dev/null +++ b/doc/sources/guide/api-android.rst @@ -0,0 +1,36 @@ +.. _api_android: + +Using Android APIs +================== + +Although Kivy is a Python framework, the Kivy project maintains tools +to easily use the normal java APIs, for everything from vibration to +sensors to sending messages through SMS or email. + +For new users, we recommend using :ref:`Plyer`. For more advanced +access or for APIs not currently wrapped, you can use :ref:`Pyjnius` +directly. + +.. _plyer: + +Plyer +----- + +`Plyer `__ is a pythonic, +platform-independent API to use features commonly found on various +platforms, particularly mobile ones. The idea is that your app can +call simply call a Plyer function, such as to present a notification +to the user, and Plyer will take care of doing so in the right way +regardless of the platform or operating system. + +For instance, the following code would make your Android device +vibrate, or raise a NotImplementedError that you can handle +appropriately on other platforms such as desktops that don't have +appropriate hardware::: + + from plyer import vibrator + vibrator.vibrate(10) # vibrate for 10 seconds + +Plyer's list of supported APIs is growing quite quickly, you can see +the full list in the Plyer `README `_. +