Skip to content

Instantly share code, notes, and snippets.

View riverfor's full-sized avatar

River Yan riverfor

View GitHub Profile
from androidhelper import Android
droid = Android()
number = droid.dialogGetInput("Phone Number", "Input the phone number you want to send hello").result
droid.phoneCallNumber(number)
from androidhelper import Android
droid = Android()
count = droid.smsGetMessageCount(False)
print("%s messages" % count.result)
messages = droid.smsGetMessages(False, "inbox").result
for message in messages:
print(" Message(%s): From %s, %s" % (message.get('_id'), message.get('address'), message.get('body')))
from androidhelper import Android
droid = Android()
clipboard = droid.getClipboard().result
droid.makeToast("clipboard: %s" % clipboard)
input(">Enter 1 continue\n")
#setClipboard
droid.setClipboard("Hello World")
from androidhelper import Android
droid = Android()
droid.vibrate(1000)
from androidhelper import Android
droid = Android()
ret1 = droid.environment().result
ret2 = droid.log("hello").result
ret3 = droid.getConstants("org.qpython.qpy3.MIndexActivity").result
print([ret1,ret2, ret3])
from androidhelper import Android
droid = Android()
ret1 = droid.makeToast("Hello").result
#ret2 = droid.getPassword("password","Please input").result
ret3 = droid.notify("notify title","notify message", "https://www.qpython.org").result
ret4 = droid.getNetworkStatus().result
ret5 = droid. sendEmail("support@qpython.org", "Hello", "This is the body").result
import qpy
import androidhelper
droid = androidhelper.Android()
ret = droid. cameraCapturePicture(qpy.tmp+"/test.png").result
#ret = droid. cameraInteractiveCapturePicture(qpy.tmp+"/test.png").result
print(ret)
import qpy
import androidhelper
droid = androidhelper.Android()
ret = droid.scanBarcode().result
print(ret)
import qpy
import androidhelper
droid = androidhelper.Android()
ret = droid.viewContacts().result
print(ret)
import qpy
import androidhelper
droid = androidhelper.Android()
contact = droid.pickContact().result
#ret = droid.pick(contact['data']).result
ret = droid.view(contact['data']).result
print(ret)