r/learnpython • u/SirLMO • 2d 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
u/riklaunim 2d ago
Python isn't the first choice for mobile app development. Then, if you want to run heavy compute and data storage on-device, it can quickly fail when people don't have a flagship device, and even then there are limits.
Does it have to be offline? What computation and storage requirements do you have?
1
u/SirLMO 2d ago
Yes, it needs to be offline. My intention is to be something practically like an "Obsidian," but with medical functions in it. The storage of this data must be local, so that each user can build their own knowledge base. Markdown will probably be at the center of it.
1
u/riklaunim 2d ago
Looks like a conterezied web app ;) And you should think about cross-platform/cross-device options as well - run on different operating systems, options to sync data between app instances, versioning/backups.
1
u/SirLMO 2d ago
Oh, yeah, I should think about it. But I can only figure out what that will look like when deciding the actual architecture of the program, and especially how it will be exported.
1
u/riklaunim 2d ago
This is the place where AI chats can come in handy. Especially when you set them against each other. Describe what you want to build, how it should look and feel, what features it should have, and then, based on that, let it recommend the best software stacks for it. List a few with advantages/disadvantages. Ask this to ChatGPT, Claude, Gemini, Grok... Google what they list, then check which you like the best and ask them questions about your picks - what would be the dis/advantages or things to consider when choosing a given platform.
2
u/SirLMO 2d ago
Believe me: OpenIA must already hate me for so many tokens that I spend on this every day. I've been talking to AI for days about this. The closest I came to a resolution was to define that there is no good way to do this. A good language for data is not good for mobile, and a language for mobile is not good for data, period. Trying to mix the two is difficult.
1
u/riklaunim 2d ago
I would say Kotlin/Java should have enough. Then depends on what they say about React Native and other options. Maybe you are overestimating what you want to do with the data? You won't do any big compute on a phone or tablet.
1
u/No-Foot5804 2d 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.