MOBILE APP DEVELOPMENT USING PYTHON

Introduction to Mobile App Development Using python language and frameworks.

Dibyanshu Mohanty
Geek Culture

--

App development is now one of the fastest growing tech skills and its stats are growing exponentially and App development has seen a lot of new frameworks and softwares being introduced into the scene, some of them have already established their reign. And if every language has asserted their presence in a field, then how would Python be left behind. And in this article, we are going to discuss the development of apps using Python. The Python ecosystem has a very wide variety of libraries that cover almost all aspects of software development. Python is vey famous its flexibility and its easy-to-understand capability. But the problem with development of apps with python is that, the native Android and iOS softwares can’t understand the language and thus, there are a bunch of frameworks and libraries that are used to bridge the gap between Native and Python applications. Let’s dive deeper and try to acquire every single bit of information about the topic.

Image: https://pythondevs.org

WHY PYTHON?

Python has established as one of the most popular languages in the recent years and the various advantages of python for Software Development purposes are:

  • Faster Programming performance:

Python programs are directly executed by the interpreter i.e. without a compiler, unlike other languages which makes it a preferable language for programming since it takes less time to execute with an easier method of catching errors.

  • Test Driven Development compatibility:

Python makes prototype creation for applications easier. It fully supports prototype development and allows you to build applications directly from the prototypes by refactoring them. Python is compatible on multiple OS and thus can be used across multiple platforms to develop and run the code.

  • Variety of Libraries:

Python allows you to choose modules from its wide range of efficient and robust library as per your requirements without a much of coding.

  • Strong Community:

A community plays a major role in the growth of a language and in the case of python, the community is very much proactive and they provide with innumerable no. of guides and tutorials and documentation which gives it an upper hand.

FRAMEWORKS FOR APP DEVELOPMENT:

· KIVY:

Kivy promotes itself as an open-source Python library for rapid development of cross-platform UI applications. It enables the developer to develop python GUIs across various platforms like Windows, Linux, iOS, Android. It has a graphics engine that is built over OpenGL, so it can handle GPU-bound workloads when necessary. But again, the question rises, When React Native and Flutter have such beautiful libraries like Material io and React libraries to develop attractive UIs then why a developer should choose Kivy. Kivy has a customized UI toolkit that offers its versions of text stickers, text entry forms, buttons etc. So, the tools are not represented using the native user interface controls but the tool ensures your mobile application’s consistency and flexibility from one platform to another. It also has a python-to-android project that lets you port Python applications to Android. It has a similar toolkit for iOS, but the iOS toolkit can only be used with Python 3.4.

If you want to work with a not-so-native UI based app, then Kivy is one of the best choices to go with since it only requires the knowledge of python and not platform concentric languages like Swift or Kotlin.

Example:

$ python3 -m venv my_kivy_project$ source bin/activate$ python -m pip install kivyfrom kivy.app import Appfrom kivy.uix.button import Buttonclass TestApp(App):def build(self):return Button(text='Hello World')

Detailed Article on developing an app in Kivy framework on https://realpython.com/mobile-app-kivy-python/

· BEEWARE:

BeeWare is another popular framework that lets you write applications in Python and compile them for cross-platform deployment on various

operating systems, including macOS, Windows and Linux GTK, as well as mobile platforms like Android and iOS. BeeWare’s repository is updated regularly. It provides you with tools and an abstract layer that you can use to write native-feeling desktop and mobile apps using Python. The major difference between Beeware and Kivy is that, Beeware uses Native UI tookit but Kivy uses a Custom UI toolkit. Since Beeware uses Native UI toolkit, Therefore, you can build awesome and Native feeling and looking UI on Cross-platform. One of the major drawbacks in using the BeeWare project is that it is relatively new and thus it requires time to build a strong community.

Example:

$ python3 -m venv .env$ pip3 install briefcase$ briefcase newFormal Name [Hello World]: PyythonApp Name [Hello]: TestAppBundle Identifier [com.example]: com.thepepper.writeHelloProject Name [First Project]:Author [Developer Name]: <Your Name>Author's Email: <Your Email>Application URL:Select one of the following:[1] Python[2] PySide2[3] NumPy[4] NoneGUI Framework [1]: 1
  • The Briefcase tool lets you create project boilerplates for specific native applications and provides an interactive way to help you create your project by prompting you for key information.

Detailed Article on developing an app with Beeware framework on

https://dev.to/pystar/build-a-native-ui-android-app-with-python-and-beeware-16me

CONCLUSION

Python has achieved greater heights and is growing at a rapid rate in the recent years and thus can be used to develop applications in the coming years in both enterprise and product basis. Odoo and Tryton are two of the many popular enterprise apps built with Python.

--

--