summaryrefslogtreecommitdiff
path: root/external/plyer/platforms/android/sms.py
diff options
context:
space:
mode:
Diffstat (limited to 'external/plyer/platforms/android/sms.py')
-rw-r--r--external/plyer/platforms/android/sms.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/external/plyer/platforms/android/sms.py b/external/plyer/platforms/android/sms.py
new file mode 100644
index 0000000..8650968
--- /dev/null
+++ b/external/plyer/platforms/android/sms.py
@@ -0,0 +1,25 @@
+'''
+Android SMS
+-----------
+'''
+
+from jnius import autoclass
+from plyer.facades import Sms
+
+SmsManager = autoclass('android.telephony.SmsManager')
+
+
+class AndroidSms(Sms):
+
+ def _send(self, **kwargs):
+ sms = SmsManager.getDefault()
+
+ recipient = kwargs.get('recipient')
+ message = kwargs.get('message')
+
+ if sms:
+ sms.sendTextMessage(recipient, None, message, None, None)
+
+
+def instance():
+ return AndroidSms()