Home > Net >  Python (back-end) and Kotlin (front-end) for Android
Python (back-end) and Kotlin (front-end) for Android

Time:10-04

Ok I was doing some data science in python over the weekend and I got to looking at python for mobile development. I was curious as to if it's possible to use both Python (back-end) and use Kotlin (front-end) together?

I know python is a non GUI unless you use kivy or flask. However I was thinking if it's possible can you cross python and Kotlin together.

There is a lot apps that use python as the backend, and another language for the front end. I have done some research and found that Kivy (unstable from my research) can be used for mobile development. However for Android Kotlin is the preferred choice by Google.

Which throws me off because Google uses python for the backend. So when you look at the Google Apps on the Play Store, are they using python and java in mobile apps?

The app I am planning which will be released to Google Play on my developer page will be a Data Driven app. So things would go much smoother if I could combine the two.

Has anyone tried using python and Kotlin? However, would I be stuck with Python and Kivy?

CodePudding user response:

The language used to program frontend vs backend don't matter, the only thing that matters is how the two communicate (assuming when you say backend you mean like a server and not like a game engine). Traditionally, applications will communicate with a backend using a REST API. So long as both sides abide by the same rules for talking to each other, it doesn't matter what language they were programmed in, known as a communication protocol.

The situation that you presented of a Kotlin frontend with a Python backend is definitely being used in production environments, and you shouldn't be afraid to do so either.

See also this related question, though I personally wouldn't recommend using Python to write an Android application because I believe natively supported first-class languages are going to produce more performant, reliable apps than non-native second/third-class languages (I haven't done more than find that SO question, so take my opinion with a grain of salt)

  • Related