Initial commit
This commit is contained in:
commit
744cfaebc2
678 changed files with 67709 additions and 0 deletions
src/main/python
28
src/main/python/main.py
Normal file
28
src/main/python/main.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
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, '')
|
||||
|
||||
# close the activity once the service starts
|
||||
# ideally, we should have some form of service control for the activity
|
||||
context.finish()
|
||||
|
||||
return Builder.load_string(kv)
|
||||
|
||||
if __name__ == '__main__':
|
||||
ServiceApp().run()
|
Loading…
Add table
Add a link
Reference in a new issue