I have a simple requirement to run a set of files on url on MediaPlayer
.
I am writing a script to do this.
There is a variable mediapath in MainActivity.java
which takes url path.
Is it possible to give this variable url value using android monkeyrunner script.
currently there is no device.set function to set the particular value.
My script is:
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
package = 'com.example.diagplayer'
activity = 'com.example.diagplayer.MainActivity'
file = open('filelist.txt', 'r')
rows = file.readlines()
for file_name in rows:
uri=file_name
extra = {}
extra['URI']=uri
print(uri)
runComponent = package + '/' + activity
device.set("MediaPath","uri")//getting error here
device.touch(100, 350, MonkeyDevice.DOWN)
device.touch(10,350, 'DOWN_AND_UP')