unpack into subdirectories __kivy_root__ of private and external storage...#350
unpack into subdirectories __kivy_root__ of private and external storage...#350denys-duchier wants to merge 3 commits into
Conversation
|
This PR is not finished. I have not touched PythonService.java because I don't really know what that is yet. As I am an Android novice, I would appreciate any help, tips, or pointers that you may provide. |
|
I have tested service support and it appears to work. File from kivy.app import App
from kivy.lang import Builder
from android import AndroidService
class MyApp(App):
service = None
labels = ["hello", "world"]
flag = False
def build(self):
return root
def start_service(self):
if not self.service:
self.service = AndroidService("Python For Android Test Service", "running")
self.service.start(self.labels[int(self.flag)])
self.flag = not self.flag
def stop_service(self):
if self.service:
self.service.stop()
self.service = None
def on_stop(self):
self.stop_service()
root = Builder.load_string("""
BoxLayout:
orientation: "vertical"
Button:
text: "Start"
on_release:
app.start_service()
Button:
text: "Stop"
on_release:
app.stop_service()
""")
MyApp().run()File import os
import time
arg = os.getenv('PYTHON_SERVICE_ARGUMENT')
while True:
print("=== Python Service:", arg)
time.sleep(0.5)So, unless you see something I missed, I'd say this PR is ready. |
|
@denys-duchier as prommised |
|
@olymk2 thanks a lot! |
|
This was needed, even if the name Can you try to rebase your branch? It cannot be merged :( Thanks! |
5fee025 to
a39b381
Compare
|
Ok, I rebased and tested and it still works for me. I chose |
|
After discussing with the team, we would like you to rename Would you mind to do it? Thanks! |
|
there you go: |
…age. Since unpacking performs first a recursiveDelete, everything stored in an unpack root is lost after an app update. In order for e.g. a database on private storage to persist across app updates it was necessary to make the private unpack root a subdirectory of private storage rather than the top level.
1e7928b to
b75c435
Compare
|
It looks like this was finished, but never merged. Does anyone have any objections if I apply it to the old toolchain, and port to the new one? |
|
I have been testing this with the old_toolchain branch. apparently it expects the old path in that initialization. |
|
another issue: |
|
Closing since this is now resolved. |
....
Since unpacking performs first a recursiveDelete, everything stored in an
unpack root is lost after an app update. In order for e.g. a database on
private storage to persist across app updates it was necessary to make
the private unpack root a subdirectory of private storage rather than
the top level.