News for hackers. Stuff that matters.
Re:MicroPython, a few years on by supergreg on Friday February 26, 2016 @09:10AM (#11181400)
Can micropython be used to make Android apps?
Re:MicroPython, a few years on by rupellohn on Friday February 26, 2016 @09:50AM (#11181624)
For regular Android apps using Python you might want to look into Kivy: https://kivy.org/docs/guide/android.html
Re:MicroPython, a few years on by dbcurtis on Friday February 26, 2016 @09:44AM (#11181592)
first, lets be clear about Micropython, the software versus PyBoard, the reference hardware. Micropython on a Pyboard is runnunig on bare metal with no OS. Micropython is very portable, and builds nicely on Linux, yielding a nice small-footprint Python. I am not aware of a build for Android, but it seems like it should be straightforward. Everything about Micropython is tuned for low memory footprint, so it might be a great tool for Android aps.
Re:MicroPython, a few years on by unwind on Friday February 26, 2016 @09:46AM (#11181606)
But Android is based on Linux, i.e. it wouldn't allow MicroPython to run directly on the bare metal.

So that would seem to make actual Python a better candidate for Android porting. I found http://qpython.com/ which seems interesting, but the site didn't look finished.

Re:MicroPython, a few years on by inclemnet on Friday February 26, 2016 @10:11AM (#11181736)
Python indeed runs fine on Android once you can get it to compile (the interpreter needs to be patched to compile with bionic, or can be compiled without patches using the CrystaX NDK). The Kivy graphical framework has the associated python-for-android project [1] taking care of doing this plus including other components like Python modules (including complex ones like numpy) and can compile with different kinds of backend (not just Kivy). There are also other projects running Python on Android in different ways.

[1] https://github.com/kivy/python-for-android

Re:MicroPython, a few years on by dbcurtis on Friday February 26, 2016 @10:23AM (#11181793)
Yes, it would run on Android the way it runs on Lunux, as an OS process. The benefit is extreme parsimony with respect to RAM use.
Re:MicroPython, a few years on by pfalcon on Friday February 26, 2016 @05:58PM (#11184935)
I started Android port: http://forum.micropython.org/viewtopic.php?f=15&t=898 . It's primary goal not to make normal Android apps (.apk's), but to access Android APIs from command line (like adb). Here's quick example what it can do: https://github.com/pfalcon/micropython-projs/tree/master/and... . I also have an OpenGLES example someone which turns out I missed to push. Of course, I though about making "normal" apps too, but that would be a long way and bunch of effort.

With ESP8266 port kickstarter, Android port is put on hold.

Re:MicroPython, a few years on by ecopoesis on Friday February 26, 2016 @10:41AM (#11181909)
You'd be better off trying to to use Jython (which compiles Python to JVM bytecode) because that would give you interop with Android's Java libraries.
Re:MicroPython, a few years on by inclemnet on Friday February 26, 2016 @10:46AM (#11181944)
I'm not aware of anyone having succeeded with Jython - I think there are technical issues but I'm not sure what's the nature of the problem.

One option for interacting with java from python is to use tools like pyjnius (http://pyjnius.readthedocs.org/en/latest/) - this is what e.g. Kivy does to get system information like screen metrics.

Re:MicroPython, a few years on by pfalcon on Friday February 26, 2016 @06:07PM (#11184984)
MicroPython Android support mentioned above is exactly inspired by pyjnius. My initial interest for uPy Android is to just hack on Android, not produce walled-garden (APK) apps. But I intended to post about this effort on Kivy list to see if someone might be interested. The idea might be to have something small, like https://love2d.org/ , but in Python. Note that I myself not really interested in cloning love2d, but if some readers of these comments would find idea interesting and could spread the word to Kivy circles, that would be appreciated (you never know what may come up if wide community gets involved - that's the beauty of Open Source).
Re:MicroPython, a few years on by cushychicken on Friday February 26, 2016 @09:26AM (#11181489)
You could likely interface with Android using MicroPython's wifi interface (which will almost certainly be included in the upcoming ESP8266 release) or using the micro:bit's Bluetooth Low Energy link.