lbry-android-sdk/src/main/python/main.py

29 lines
768 B
Python
Raw Normal View History

2017-08-13 02:24:00 +01:00
from kivy.app import App
from kivy.lang import Builder
from kivy.utils import platform
kv = '''
Button:
text: 'push me!'
'''
class ServiceApp(App):
def build(self):
if platform == 'android':
from jnius import autoclass
Intent = autoclass('android.content.Intent')
LbrynetService = autoclass('io.lbry.lbrynet.LbrynetService')
context = autoclass('org.kivy.android.PythonActivity').mActivity
#LbrynetService.start(context, '')
2017-08-13 02:24:00 +01:00
# close the activity once the service starts
# ideally, we should have some form of service control for the activity
#context.finish()
2017-08-13 02:24:00 +01:00
return Builder.load_string(kv)
if __name__ == '__main__':
ServiceApp().run()