Skip to content
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

Android support via Kivy #39

Closed
GijsTimmers opened this issue Dec 8, 2014 · 14 comments
Closed

Android support via Kivy #39

GijsTimmers opened this issue Dec 8, 2014 · 14 comments
Assignees
Labels

Comments

@GijsTimmers
Copy link
Owner

We should check whether we can support Android. Maybe Kivy is the way to go.

@GijsTimmers
Copy link
Owner Author

I've worked a bit on it, and it's really dirty code. At the moment, it doesn't look like it can be easily combined with the current codebase. Therefore, I propose to separate this into a different low-priority project: kotnetgui-mobile. Another reason to do so is that the Android version isn't really kotnetcli anymore. Kivy seems to support iOS too, so maybe we can create both .apks and .ipas.

@GijsTimmers GijsTimmers added @low and removed @medium labels Jan 1, 2015
@jovanbulck
Copy link
Collaborator

no idea on how easy it is to run python on android, but from a software design point of view, the android app should ideally be just another front end

kotnetcli.py will encapsulate the command line interface, parsing arguments to create the necessary back-end objects and start the machinery. Ideally (dont know if this is feasible), this can be implemented in a simple android app, without changing the back-end...

@GijsTimmers
Copy link
Owner Author

In that case, we'll have to at least create a different file for it. It can't be put in kotnetcli.py.

@jovanbulck
Copy link
Collaborator

yep indeed kotnetapp.py or so

@GijsTimmers
Copy link
Owner Author

Sitrep

I spent yesterday evening and today's afternoon, trying to get Kivy to compile, using mostly buildozer, but also python-for-android.

I haven't had any success doing so. Getting buildozer to work on a modern version of Ubuntu is a PITA. I'm constantly getting the error:

subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1

I've googled it, and it seems to have something to do with using a 64 bit version of Ubuntu, so I tried the proposed Virtualbox image.

This Virtualbox runs a 32-bit Ubuntu Quantal Quetzal, which is very bad at getting virtualized. After re-enabling the old software sources (old-releases.ubuntu.com), I managed to pull in lubuntu-core to have a better experience.

I tried compiling in this virtualbox, but it still fails. As soon as I get it working, I'll share a snapshot of this VM with you, so we have something to work with.

I found an online APK builder, which is kinda cool, but I've been waiting for 45 minutes now, and it hasn't compiled anything yet.

@GijsTimmers
Copy link
Owner Author

Some updates

I've tried a lot to resolve the error above, but nothing did the trick. Right now, I've posted an issue on the buildozer github, but in the meantime, I'll try compiling with python-for-android. That will be a lot harder, but it may work. Fingers crossed.

@GijsTimmers
Copy link
Owner Author

Update: I've managed to succesfully compile a Hello World app. We can now start working on the app.

Proof-of-concept demonstration video

@jovanbulck
Copy link
Collaborator

I've created a class diagram depicting intended android app integration with kotnetcli back-end; looks clean this way I think :-)

class diagram

@GijsTimmers
Copy link
Owner Author

Hi, this looks very nice. I agree on everything depicted here except for the progress output. Spawning a QuietLoginCommunicator here with a progressbar would be fancy, but we'd lose the cli aspect, which is something that's very dear to me. Actually, I see it as our task to get non-Linux people comfortable with terminal output.

What do you think about a combined approach? Terminal output and a progressbar at the same time? That would be fine for me, as well.

@jovanbulck
Copy link
Collaborator

What do you think about a combined approach? Terminal output and a progressbar at the same time? That would be fine for me, as well.

Yep good idea; the progress bar field was just a quick idea to show the general concept (of an Androidcommunicator that modifies Kivy-elements to display the progress)

@GijsTimmers
Copy link
Owner Author

A small update video to show you what the app currently looks like. Note that all shown behaviour is real: the login and parsing actually works.

Video

@jovanbulck
Copy link
Collaborator

Good progress here :-)

I think however, we should certainly not copy the necessary back-end classes as documented in issue #76 The ideal is depicted on the class diagram that I posted above:

class diagram

We should simply write implementations for the Android dependent classes (such as communicator, keyring, ...). The real workhorse back end code (worker, browser, ...) however, should not be duplicated. Code duplication is always the number one bad smell.

As far as I understand now, problems arise when trying to compile a Kivy app that simply imports for example a back-end Browser class. We should thus try to fix these: what is the exact nature of the problem? Has it something to do with the conflicting imports of BeautifulSoup and Mechanize? If so, we should probably drop BeautifulSoup and replace it with a regex?

@GijsTimmers
Copy link
Owner Author

We should simply write implementations for the Android dependent classes (such as communicator, keyring, ...). The real workhorse back end code (worker, browser, ...) however, should not be duplicated. Code duplication is always the number one bad smell.

Agreed.

As far as I understand now, problems arise when trying to compile a Kivy app that simply imports for example a back-end Browser class. We should thus try to fix these: what is the exact nature of the problem? Has it something to do with the conflicting imports of BeautifulSoup and Mechanize? If so, we should probably drop BeautifulSoup and replace it with a regex?

Probably, so the way to go right now would be to create a proof-of-concept parser based on re (the regex module) instead of BeautifulSoup.

@GijsTimmers
Copy link
Owner Author

We're not going to do this via Kivy. We made a lot of progress in the past, but the whole compilation procedure is just a pain in the ass.

Instead, we'll create a separate project, written in Java and fully native. You can find this project here: https://github.com/GijsTimmers/kotnetcli-mobile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants