Hacker News new | ask | show | jobs
by ghaven 4582 days ago
How about kivy (http://kivy.org/#home) for something of a middle ground? It's a python graphical framework making heavy use of opengl via an optimised cython interface. It has fairly powerful access to the android api through pyjnius (which gives direct access to java classes) or pyobjus on ios (which is less mature but has the same idea).

On the plus side, since it's native to the device (albeit with a different interface), you can do pretty well for speed through the already optimised graphical interface and through optimising your own apps with cython or even C modules if necessary. Other pros include pyjnius/pyobjus for api integration as above (some of which is already abstracted as python modules), and neat perks like the ability to mostly develop on desktop without an emulator.

On the other hand, it has some of the same disadvantages as html5, such as non-native widgets. So by no means a perfect solution, but an interesting contender.

1 comments

The biggest downside I found with kivy is the amount of time it takes to launch the app as it has to set up the python environment et al. If that's improved with newer versions of kivy I might go back to see what it can do.
That's still a problem unfortunately, though less so than it used to be so your perception might depend on when you last used it.

If you're interested, you could try perhaps FlatJewels from the play store. It's a simple game with a fairly quick loading time (except the first run, which is always slower). I don't know if the author put effort into specifically optimising its start time, but it's probably fairly representative of what's currently normal.

The other standard downside of kivy is the mandatory giant app footprint. Hello World is going to set you back 25mb on Android.
I think this could be misleading...a kivy apk has a minimum size of about 6-7MB. When installed it will extract the contents but the apk remains, which more than doubles that size on the device storage. The extraction can be done to the sd card (or internal equivalent) so as not to take up system internal memory space.

It's certainly another downside of course, but to be clear to anyone reading the apks are much less than 25MB. And 25MB actually sounds like more than I'd expect even uncompressed, but I haven't looked at it much.