Skip to content

Latest commit

 

History

History
210 lines (132 loc) · 2.4 KB

plyer_command_list.rst

File metadata and controls

210 lines (132 loc) · 2.4 KB

Command list

TTS(Text to speech)

Example:

from plyer import tts
tts.speak('text')

top

GPS

Note

This will work only on versions before android 6.0 .

For android 6.0 + the coder needs to explictly ask permissions.

Here is an example of the usage of gps:

from plyer import gps
coordinate = 0
def print_locations(**kwargs):
    global coordinate
    coordinate = kwargs

gps.configure(on_location=print_locations)
gps.start()
# later
print coordinate
gps.stop()

Notification

Example:

from plyer import notification
notication.notify('Text')

SMS

Example:

from plyer import sms
sms.send(recipient=self.sms_recipient, message=self.sms_message)

Uniqueid

Example:

from plyer import uniqueid
uniqueid.id

vibrator

Example:

from plyer import vibrator
vibrator.vibrate(10)

Compass

Example:

from plyer import compass
compass.enable()
compass.orientation
compass.disable()

Flash

Example:

from plyer import flash
flash.on()
flash.off()

camera

Example:

from plyer import camera
camera.take_picture

E-Mail

Example:

from plyer import email
email.send(recipient='abc@gmail.com', subject='Message')

Call

Example:

from plyer import call
call.makecall('9013159973')

Accelerometer

Example:

from plyer import accelerometer
accelerometer.enable()
accelerometer.acceleration

Battery

Example:

from plyer import battery
battery.status

Gyroscope

Example:

from plyer import gyroscope
gyroscope.enable()
gyroscope.orientation
gyroscope.disable()

Orientation

Example:

from plyer import orientation
orientation.set_landscape()
orientation.set_portrait()

Audio

Example:

from plyer import audio

IrBlaster

Example:

from plyer import irblaster