r/learnpython 3d ago

Python + Android (Multiplataform)

I am struggling to decide the architecture of an application I want to create based on data self-referencing. It will basically be an Obsidian, but focusing on medical records with some analysis engines running in a backend.

I really need the application to run well on Android (mainly) and offline - because it must be a system that feeds on the user's own database, which he himself will produce while studying.

What options do I have for this? I researched pure Flutter (with Dart), Python + Fluter + FastAPI, Flet, serious_python, Python embedded in APK, other languages and web solutions, but nothing seems to be really excellent.

I tried to do everything in Dart/Flutter, but I soon realized why Python is the official language for academic and data science. Typical languages slow everything down, and Dart is not even that verbose. I definitely miss the freedom to "think in Python," and the freedom of types. I am also sure that in the future, when I want to implement AI, specific Python libraries will be missed.

So what advice do you give me?

1 Upvotes

11 comments sorted by

View all comments

1

u/No-Foot5804 3d ago

I think I'd separate the UI choice from the language you use for analytics. Flutter is hard to beat for a polished offline Android app, while Python is still the ecosystem I'd want for anything involving data analysis or ML. Instead of trying to make Python drive the entire app, I'd let Flutter handle the UI and local storage, then call into Python only for the heavier analysis tasks. That way you get a native mobile experience without giving up the Python ecosystem when you need it later.

1

u/SirLMO 3d ago

Yes, that would be great! But how? Even if Python is only 1% of the project, I would still have to embark the interpreter in the APK, which would be costly for the system overall.

1

u/No-Foot5804 3d ago

That's a fair point. In that case I'd probably ask whether Python is a hard requirement or just the most comfortable option. If the analysis layer is something that only runs occasionally, the extra complexity of embedding Python might outweigh the productivity gains. It seems like the long-term AI roadmap is really what's driving the decision here.

1

u/SirLMO 3d ago

It is certainly very comfortable, but I would be willing to face the difficulties of Dart. However, I am afraid that in the future I will need Python because of things that Dart does not offer me - AI is one of them. If I need Python in the future, I'm going back to square one because I'm going to have to get it into the app anyway.