2015-07-18, 20:23
Hey everyone!
So, I just recently got a FireTV Stick and have been experimenting with the way I can interact with one Android App with Kodi (RC2).
I am aware of the builtin function StartAndroidActivity(package,[intent,dataType,dataURI], but it doesn't seem to support extra parameters, so I built a .sh script to call it and it works when launched from adb command line.
/sdcard/test.sh
I took the "Hello World!" addon, and modified it to see if I could make it launch the script, and this is where I'm stuck.
Also tried without sucess:
The code doesn't throw any errors, but the .sh script doesn't run either. Maybe it's because the file is not executable? I can't "chmod +x" the file because I don't have root privileges, so I don't know what other solution I have here. It does run from adb however.
I've also had a look at the python android module, but it doesn't seem to be available, and i'm not sure if it's possible to "import it" somehow?
This is what it would look like:
Also thought about doing a PHP script instead, but I can't seem to run a PHP Server on the FireTV either...
Any help would be appreciated
So, I just recently got a FireTV Stick and have been experimenting with the way I can interact with one Android App with Kodi (RC2).
I am aware of the builtin function StartAndroidActivity(package,[intent,dataType,dataURI], but it doesn't seem to support extra parameters, so I built a .sh script to call it and it works when launched from adb command line.
/sdcard/test.sh
Code:
#!/system/bin/sh
am start -a "appxpto.intent.action.OPEN" -c "android.intent.category.DEFAULT" -e "extrapar" "extravalue"
I took the "Hello World!" addon, and modified it to see if I could make it launch the script, and this is where I'm stuck.
Code:
import sys
import xbmcaddon
import xbmcgui
import os
bashCommand = "/system/bin/sh /sdcard/test.sh"
os.system(bashCommand)
Also tried without sucess:
Code:
import sys
import xbmcaddon
import xbmcgui
import os
bashCommand = "/system/bin/sh /sdcard/test.sh"
subprocess.call(bashCommand, shell=True)
The code doesn't throw any errors, but the .sh script doesn't run either. Maybe it's because the file is not executable? I can't "chmod +x" the file because I don't have root privileges, so I don't know what other solution I have here. It does run from adb however.
I've also had a look at the python android module, but it doesn't seem to be available, and i'm not sure if it's possible to "import it" somehow?
This is what it would look like:
Code:
import sys
import xbmcaddon
import xbmcgui
import os
import android
droid = android.Android()
droid.startActivity('appxpto.intent.action.OPEN',
None,
None,
{"extrapar":"extravalue"},
False,
'com.appxpto.appxpto',
'android.intent.category.DEFAULT'
)
Also thought about doing a PHP script instead, but I can't seem to run a PHP Server on the FireTV either...
Any help would be appreciated