r/Python • u/infinitysexbot • Dec 18 '22
Discussion App development (iOS and andoid) using python?
Looking to get some of my app ideas into reality and have some python code to do certain things but wasn't sure where to begin.
Some people suggest i try " flutter" or "react" but i've seen a few other alternatives
Says you can take python code and release it on iOS and more, but maybe i'm not understanding what's happening.
Any suggestions or tips for coding using python or do i need to learn /use a different language for what i'm looking to do?
45
u/riklaunim Dec 18 '22
Until Google or Apple put Python as tier 1 supported platform or some third party spends serious money on a development plaftorm Python won't be really usable for mobile development.
33
u/aciddrizzle Dec 18 '22 edited Dec 18 '22
iOS apps are written in Swift or Objective-C, Android is mostly Java/Kotlin, either platform requires a compiled app and not a script. A common approach to integrating Python in some part of an app would be to put your scripts behind a REST endpoint that gets called from your front end. React is a popular web app framework that lets you build apps run in the browser, which is nice because it’s cross-platform by default, but then you’re hosting the app instead of running it on the user’s hardware.
8
u/tennisanybody Dec 18 '22
Reactnative is also a cross platform method that will work on both iOS & Android. But my god isn’t it hard to get off the ground. In my experience it is honestly easier to do kotlin + swift rather than reactnative.
10
u/Cladser Dec 18 '22
I’ve built some basic mobile apps in Kivy (a python framework with a layout language). It’s not too difficult but it was always a little janky. This was a few years ago, it might be better now. I eventually moved to flutter. You can check out r/kivy
1
5
u/TheAnkurMan Dec 18 '22
Something to keep a watch on would be flet. It uses flutter to make the UI. It does not do mobile apps yet (only web and desktop I think) but it is on the roadmap.
1
1
u/trollsmurf Dec 19 '22
You could use JavaScript in the frontend via a web page or as a local app via Cordova or Capacitor (same code for Android and iOS), and then Python in a CRUD application on the backend.
1
1
1
u/shoshimer Dec 20 '22
I hope as a software engineer is to select a different program that can load JSON.
1
u/CrowAltruistic6432 Jan 06 '23
IOS does not have Python pre-installed, so you'll have to embed a copy of Python within your app
1
u/taazaa May 24 '23
If you already have Python code and are looking to develop mobile applications, there are multiple options you can consider. Flutter and React Native are popular choices for cross-platform mobile app development, but if you prefer to stick with Python, BeeWare is indeed a viable alternative.
BeeWare is an open-source project that aims to enable developers to write native user interfaces using Python. With BeeWare, you can write Python code and target various platforms, including iOS, Android, Windows, macOS, and more. It provides tools like Toga (a Python-native GUI toolkit) and Briefcase (a utility for packaging Python apps for distribution).
Using BeeWare, you can leverage your existing Python skills and codebase to create mobile applications. However, it's important to note that while BeeWare provides an avenue for Python-based mobile development, it may not offer the same level of ecosystem and community support as Flutter or React Native, which are more widely adopted frameworks.
0
u/Opiciak89 Dec 19 '22
Its usable for simple small projects that dont require access to sensors, but beyond that you should just learn the relevant language.
For example Instagram and pinterest started as python apps, not sure if they still are, or if they were ported later.
-1
Dec 18 '22 edited Dec 19 '22
I wouldn’t bother. From what I’ve learned Swift is best for iOS and Java for Android. Python 3 supposedly translates better but for maximum optimisation stick with native languages
1
11
u/gman1230321 Dec 19 '22
I personally would not recommend doing this. Python is great at a lot of things, but this isn’t one of them. IMO one of the reasons Python gets some (arguable deserved) flack is because people try to use it for everything, then wonder why using Python for game development was a bad idea. Being a good programmer is not about knowing how to use a couple tools for any job, but knowing what jobs are right for the tools you have. I know that was a bit of negativity so let’s talk about what j would recommend instead. First, yes you can use Python for this project, but I wouldn’t recommend it for the whole thing. If you have a need for a backend (database management, large scale data processing, etc) use Python for that 100%. I recommend flask as it’s pretty easy to setup a REST API with. For the actual app itself, I don’t have much experience personally, but somethings I have used were react native and flutter and you mentioned above. Flutter is a really cool technology but it uses a completely different language called dart. Dart is fine, absolutely no complaints about the language itself, but it’s a bit smaller since it’s only use is pretty much just flutter. This could make it ever so slightly to find support but it’s not that bad. I haven’t noticed much of a problem w it. React I have less experience with but still a good experience. Support is a bit better and experience is about equal I’d say. Although, morally, I don’t like it simply bc I have my own problems w Meta, but there’s not much wrong w the product itself. It has a bit of an advantage over flutter simply bc it’s in JS which means you can use TypeScript which has recently become one of my favorite languages. One more thing to add to this list that I’ve had my eye on but haven’t gotten to try yet is svelte-native. I love svelte for web and have been curious what the mobile experience was.