Skip to content

SL4A integration: SL4A's extensive API can be used before a total pyjnius port #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 48 commits into from

Conversation

alanjds
Copy link
Contributor

@alanjds alanjds commented Jan 8, 2014

SL4A had already implemented lots of Android APIs to be used for script languages, and most of the examples are wrote in Python, including a native UI subframework with samples.

No doubt that pyjnius can do amazing things in a cleaner and faster (perfomant) way than this one, but SL4A can already provide most the API that we need without spending the time to port to pyjnius right now.

Lets accept SL4A for now and than plan on converting the whole API to pyjnius?

@alanjds
Copy link
Contributor Author

alanjds commented Jan 8, 2014

Question: Right now, this is named sl4acompat. Should be renamed to sl4a or sl4asomething and reserve sl4acompat to the pyjnius version of a same-API future module?

@tito
Copy link
Member

tito commented Jan 14, 2014

sl4acompat is a good name. Don't put the sl4a related files by default in src, but copy it in the dist if the recipe is used. Then even you have the .java files only if you want it.

@@ -0,0 +1,27 @@
#!/bin/bash

URL_sl4acompat=https://github.com/damonkohler/sl4a/raw/dcfa832f80/android/script_for_android_template.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible, use the same construction as we do in kivy/others libs, ie, extract the version in a variable, then we can use sl4acompat==<version>.
Example in Kivy: VERSION_kivy=${VERSION_kivy:-stable}: stable is the default version.

@alanjds
Copy link
Contributor Author

alanjds commented Jan 18, 2014

@tito: thanks for the comments! I knew that its far from perfect, but needed a working PoC to grab "stop now" or "keep going" feedback. I will take this as a "keep going, we will merge when cleaned a bit more".

Can you please take a look at #189 and #192, as the Python part of the contributed recipe will need this ones to work?

@alanjds
Copy link
Contributor Author

alanjds commented Jan 18, 2014

Just to reinforce, I believe that every things should be done with pyjnius. In fact, I believe that Plyer should be implemented for android using some module API-compatible with the SL4A API, as this API have tons of usage examples. Than the intermediate compatible layer could be ported to pyjnius in parallel with Plyer development.

Does it makes sense?

@tito
Copy link
Member

tito commented Jan 18, 2014

We already taken inspiration on SL4A and ... (i don't remember the name, but it has been renamed few years ago, HTML5/js framework), but never put time to plyer (except Ben who did amazing jobs on the notifications).

I would not accept plyer to use the RPC system, but implementing plyer interface with sl4a inspiration, yes. For the new object that need an API, take time to learn about others platform, and see if the API proposed by SL4A would fit, or if it needs to be adapted. Then do an API, and implement it :)

It's not hard really, just time is needed to do proper things / stable API

@alanjds
Copy link
Contributor Author

alanjds commented Jan 18, 2014

I understand. Nobody likes the RPC system, as it sucks. My problem on this is that I need to do some PoC to get resources to reimplement The Right Way. I mean time and people willing to help "clean" the mess. But some people only step up after seeing a PoC :/

Anyway, I totally understand on not allowing Plyer to be built over some RPC system, even temporarily.

@alanjds
Copy link
Contributor Author

alanjds commented Jan 18, 2014

Hum... I think that maybe I was not that clear on my (lack of) vision: I see a good model on having:

For the PoC world: Plyer -> SL4A API -> RPC -> SL4A Service -> Java (you having the right to dislike and not merge it)
For the porting "contest": Plyer -> SL4A API -> raise NotImplementedError()
For the ideal world: Plyer -> SL4A API -> pyjnius -> java

This way I can keep compatibility with existing codes/examples on the future, and ideally would have two teams/taskforces: one working on Plyer, and assuming that the underlining API works, and another working on the port to pyjnius.

The main reason is that I see real value on the pyjnius-based compatibility layer, but its just my opinion :)

@tito
Copy link
Member

tito commented Jan 18, 2014

After a night's sleep, i think that despite my personal opinion, it would be bad to your contribution. The "behind the hood" is our issue, not the user issue. If you are motivated, then maybe i can motivate people to write too, and we might be able to do the ideal at the same time.

For example: i can add you directly on the plyer project. We create a branch, and start to create only the API that sl4a have and we don't have. Only after, i'm 200% that some API are so simple that pyjnius usage will be straightforward. For the one that are not obvious, use the sl4a RPC approach.

Then, in the plyer documentation, indicate that if you want to have all the features, enable sl4acompat recipe in python-for-android. After a while, when it will not be needed anymore, just remove the requirement.

Does that looks good to you ?

Feel free to join irc.freenode.net on #kivy channel

@alanjds
Copy link
Contributor Author

alanjds commented Jan 18, 2014

Looks good. Well... I will work on the kivy-remote-shell service before getting back to this one. Then will architect and start the middle layer. I really believe in having something between Plyer and pyjnius/sl4acompat. What is usually the best time for you to talk on the IRC?

@trivedigaurav
Copy link
Member

Can we move this to plyer instead?

@alanjds
Copy link
Contributor Author

alanjds commented May 31, 2014

@trivedigaurav I am not against, but it needs changes on the AndroidManifest.xml

I dont know a way for the recipes to do this kind of additions before the build right now.

@trivedigaurav
Copy link
Member

@alanjds Would you like to discuss this on IRC?

@alanjds
Copy link
Contributor Author

alanjds commented Jun 2, 2014

@trivedigaurav Sure. Tonight after the workday I will log to IRC, ok? If you got there, lets talk. See ya :)

@trivedigaurav
Copy link
Member

Sure. What timezone would it be though?

On Mon, Jun 2, 2014 at 8:52 AM, Alan Justino da Silva <
notifications@github.com> wrote:

@trivedigaurav https://github.com/trivedigaurav Sure. Tonight after the
workday I will log to IRC, ok? See ya.


Reply to this email directly or view it on GitHub
#191 (comment)
.

@alanjds
Copy link
Contributor Author

alanjds commented Jun 2, 2014

I am on GMT-3. Will probable get online about 21-22:00 GMT-3, and be there for about two or four hours.

@tito
Copy link
Member

tito commented May 16, 2015

I'll close this PR. Many work has been done later on plyer, we even got this year another GSOC on it. Use plyer instead!

@tito tito closed this May 16, 2015
@tito
Copy link
Member

tito commented May 16, 2015

And a big kudo to @alanjds for this work, even if it didn't got merged, this motivated us to go in a better direction faster ^^

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.

3 participants