Skip to content

minimal bootstrap for PythonService#729

Merged
inclement merged 15 commits into
kivy:masterfrom
brussee:service_only
Jun 22, 2016
Merged

minimal bootstrap for PythonService#729
inclement merged 15 commits into
kivy:masterfrom
brussee:service_only

Conversation

@brussee

@brussee brussee commented May 4, 2016

Copy link
Copy Markdown
Contributor

Meant to be used with export_dist to just run a Python service from a normal Android app.

@brussee

brussee commented May 6, 2016

Copy link
Copy Markdown
Contributor Author

It does what I would like it to do.

I've also added a clean_bootstraps command to p4a toolchain.py

@brussee brussee changed the title [WIP] minimal bootstrap for PythonService minimal bootstrap for PythonService May 6, 2016
@inclement

Copy link
Copy Markdown
Member

Nice. Would you be able to include my additions to the jni/src folder in the webview bootstrap to enable pyjnius to work with this bootstrap (plus some appropriate patch in the pyjnius recipe)? I think you just need to copy pyjniusjni.c and add it to the Android.mk.

I don't see a recipe calling ndk-build to actually build the start.c. Am I missing something here, or you would call it separately once the dist is exported (I'd have thought this wouldn't work due to path problems)?

@brussee

brussee commented May 8, 2016

Copy link
Copy Markdown
Contributor Author

The gradle build implicitly builds all .c files in the jni folder.

Some documentation about how to import the build files from the dist into a Android Gradle project is needed I think.
If I have time I will add that and also take a look at the pyjniusjni.c

Thanks for merging all my PR's!

@brussee brussee force-pushed the service_only branch 2 times, most recently from 180ac06 to d0bf809 Compare May 28, 2016 18:05
@brussee

brussee commented May 28, 2016

Copy link
Copy Markdown
Contributor Author

I rebased on ac25fab and added pyjniusjni.c but have not tested pyjnius.

@inclement

Copy link
Copy Markdown
Member

pyjnius will need a patch modification to work with this (currently it checks for the webviewjni recipe, but in retrospect this was a bad name and it should be something generic for all these bootstraps). If I merge this and make a couple of changes to that end, would you be able to test pyjnius in a trivial example (just import and autoclass)?

(Other than that, sorry for the delay, am I right in understanding that this is working well for you?)

@brussee

brussee commented Jun 15, 2016

Copy link
Copy Markdown
Contributor Author

Sorry for the delay. In the next couple of weeks I will be working on documentation.
Indeed it is working well for me for a while now.
I might (limited time) be able to test pyjnius after you merge the rename / refactor the webview components.

@brussee

brussee commented Jun 21, 2016

Copy link
Copy Markdown
Contributor Author

I've just confirmed pyjnius to work from the Python service with this script:

        from jnius import autoclass
        autoclass('java.lang.System').out.println('Hello world')

        Stack = autoclass('java.util.Stack')
        stack = Stack()
        stack.push('hello')
        stack.push('world')
        print stack.pop()
        print stack.pop()

06-22 01:05:22.907 5503-5582/org.tribler.android:service_Triblerd I/System.out: Hello world
06-22 01:05:22.940 5503-5582/org.tribler.android:service_Triblerd I/Triblerd: world
06-22 01:05:22.940 5503-5582/org.tribler.android:service_Triblerd I/Triblerd: hello

@brussee

brussee commented Jun 21, 2016

Copy link
Copy Markdown
Contributor Author

Ready to merge :D

Documentation is not yet included.

@inclement inclement merged commit 842aedb into kivy:master Jun 22, 2016
@inclement

Copy link
Copy Markdown
Member

Great, thanks!

I changed 'clean_bootstraps' to 'clean_bootstrap_builds' for consistency. It would also be great if you could add a little doc about the purpose of this bootstrap, but there didn't seem to be a need to let it hold up merging the bulk of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants