Re:Some Sessions from the Python Language Summit
by jventura on Thursday May 28, 2020 @12:06PM
(#23338893)
I 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
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). I’m able to share all the python code but adapt the UI using the native tools..
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.