I'm doing some tests for an Android script. It is a series of randomly generated numbers that automatically and without displaying anything on the screen, go to the clipboard and is available to be copied anywhere. For now, I run without problem the following piece of code in Windows that performs the function of data entry to the clipboard.
#Introducción automática del mensaje string a clipboard
import os
def addToClipBoard(text):
command = 'echo ' + text.strip() + '| clip'
os.system(command)
addToClipBoard(result2)
However, I am not able to know how to do this on Android. I've seen that Androidhelper has a function (setClipboard)
setClipboard (text) Put text in the clipboard. text (String) Creates a new AndroidFacade that simplifies the interface to various Android APIs.
I'm doing the executions with QPython3.2. Can someone give me a cable?
EDIT: I have solved it in the following way:
from androidhelper import Android
droid = Android()
#setClipboard
droid.setClipboard("Hello World")
#getClipboard
clipboard = droid.getClipboard().result