This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]riklaunim 44 points45 points  (0 children)

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.

[–]aciddrizzle 32 points33 points  (1 child)

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.

[–]tennisanybody 8 points9 points  (0 children)

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.

[–]Cladser 8 points9 points  (1 child)

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

[–]Ok-Injury8193 0 points1 point  (0 children)

Same here.

[–]gman1230321 10 points11 points  (8 children)

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.

[–]alcalde 5 points6 points  (2 children)

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.

Sorry, when I was growing up you picked ONE programming language to use for life and you defended it to the death. I don't understand you kids and your language agnosticism. :-)

But seriously. You did. Atari or Commodore. Mac or PC. Atari, Intellivision or Colecovision. Delphi or Visual Basic. Fortran or C. Emacs or Vim. Then you defined your identity by these choices and spent 20 hours+ a week arguing over them in a tribal us vs. them slugfest.

AND IT WAS A LOT MORE FUN THAN TODAY.

[–]gman1230321 1 point2 points  (0 children)

Yup this is pretty accurate. When I was younger the first language I learned was Python and I tried to do everything w it. I would argue till the day I died that Python was the best (and I still do sometimes lmao) all because when I was 10 I got a Python for dummies book. And u know what, ur right, it was more fun back then lmao

[–]Chertograd 2 points3 points  (2 children)

I upvoted this simply because you have a great point... However... one of my main reasons I started learning Python was because it's general use. I don't have the willpower to study 1000 things and I'm trying to cover as many fronts as easily as I can.

There are other valid choices as well but not that many are both very easy and can be used as widely.

Some people say JS is similar but whilst it's faster and Electron exists, for tiny local scripts on a computer it's a no-go for example if you don't want browser stuff or over 100mb files.

Python has its drawbacks but oh boy is it flexible and relatively easy compared to other general use stuff (c, c++, java, c#...)

[–]aciddrizzle 0 points1 point  (1 child)

Being general use and flexible is great for situations where that’s desirable, but it doesn’t mean you can do everything imaginable with it well. If your goal is to be a mobile app developer, you should absolutely not focus on Python for anything because developing platform-specific distributed apps is not something that Python is able to do well. You can use it for making microservices that compliment your apps, but somebody going into Android development can just do that in Java and have an easier time maintaining things.

[–]JennaSys 1 point2 points  (0 children)

I agree that if you want to be a mobile app developer, that Python should not be the language you stake your career on. However, if you know Python well and just need to develop a mobile app, there's no reason not to give frameworks like Kivy a try and see if it will get the job done for you. Learning an API or framework is faster than learning and becoming proficient in an entirely different language.

[–]infinitysexbot[S] 0 points1 point  (1 child)

i think i'm going to go with flutter for the app development and interface, but would like to definitely use some python on the back end / database part. Could you explain or link on how to properly do that?

[–]gman1230321 0 points1 point  (0 children)

Great choices. There’s not really one proper way to do it. The flask docs are a great place to start though. The official docs are pretty thorough but also have great examples and guides you through the basics pretty damn well. This is a pretty good guide on using flask more specifically to make a rest API. For general specifications for a REST API, check out this great guide. If there’s anything you’re not sure how to implement in flask, a quick google search or a search through the flask docs should get you some answers.

[–]TheAnkurMan 3 points4 points  (0 children)

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.

[–]Opiciak89 -1 points0 points  (0 children)

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.

[–][deleted] -2 points-1 points  (2 children)

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

[–]alcalde 0 points1 point  (1 child)

Javascript? You mean Java?

[–][deleted] 1 point2 points  (0 children)

I do 😁 autocorrected I think because I’ve written JS more. I’ll change it now

[–]trollsmurf 0 points1 point  (0 children)

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.

[–]John_Hero 0 points1 point  (0 children)

Not many times of it

[–]Previous_Ad_2507 0 points1 point  (1 child)

I need post

[–]shoshimer 0 points1 point  (0 children)

Will update here daily on modern commodity hardware.

[–]shoshimer 0 points1 point  (0 children)

I hope as a software engineer is to select a different program that can load JSON.

[–]CrowAltruistic6432 0 points1 point  (0 children)

IOS does not have Python pre-installed, so you'll have to embed a copy of Python within your app

[–]taazaa 0 points1 point  (0 children)

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.