3 ms·
Nice points about the mobile Python. My old company ported Python to Symbian operating system (Nokia phones) around 2008. The problem for Python in mobile is th
by miohtama 6y ago
Nice points about the mobile Python. My old company ported Python to Symbian operating system (Nokia phones) around 2008. The problem for Python in mobile is the same as for JavaScript / React Native: The startup time is slow because modules cannot be imported or statically loaded fast.
Even though mobile phones have gotten fast, this is an severe issue with React Native apps. And Facebook is pouring in a lot of engineering to tackle it. But the progress is incremental at the best. As a result some code gets rewritten in C++ because of this issue (see e.g. Trust Wallet). Even though I love Python as a programming language I would not recommend it for consumer grade mobile application development and I feel it is unlikely to get there ever unless some breakthrough happens in runtime development.
- jventura 6y agoI have an Android app on the Play Store which uses Python and can confirm that the startup time is slow because of the imports. I think one possible solution could be to invoke the start of the interpreter outside the UI thread, at least it could give the illusion of a faster app start. Unfortunatelly the app gives me ~5€/month so it is not profitable enough for me to care. I opened source the idea at https://github.com/joaoventura/pybridge https://github.com/joaoventura/pybridge The thing that makes this different from a pure android python project is that I only use Python as a kind of mobile RPC backend. The UI is completely native in Java/Kotlin. As a side note, today I’ve open sourced the same technique, but for iOS (https://news.ycombinator.com/item?id=23335704 https://news.ycombinator.com/item?id=23335704). I’m able to share all the python code but adapt the UI using the native tools..