Wednesday, May 5, 2021

 Write once mobile applications: 

 

Introduction: BeeWare is a program that allows applications to be written once and deployed to different platforms, such as, Android phones and Apple devices. Previously, these applications were written once for Android and then rewritten for iphones and expertise grew around each ecosystem while the business logic remained independent. This has now been addressed with write-once business logic that can be run platform independent. This article describes the methods involved. 

Description:  

BeeWare emphasizes “write once, deploy everywhere” mode of mobile application developmentWhile Android platform has become synonymous with Java development and Apple device development has with Objective C, developers struggle to port business logic to either platform. Instead, BeeWare allows the application to be written in Python and released to multiple platforms. The binaries appear native to the platform on which they are released so the experience for the end-user is seamless, and this works for them since they do not want to know if the application was written in one language or the other. BeeWare is open source and the process of creating an application takes the following steps: 

  1. The pre-requisites are installed. These are also affectionately called pre-beeware. It requires the installation of pythonnet and briefcase on Windows machines. Pythonnet depends on .NET and the corresponding wheel might have a different version requirement than the latest Python. Briefcase allows easy packaging of all code and provides a framework to run the application on desktop. Toga, a cross platform widget toolkit and Rubicon libraries for targeting platform specific code can also be counted as prerequisites for their purpose. 

  1. The first application is simply an empty placeholderIt is created and run with briefcase dev command and launches the application with an interface which has no business logic. 

  1. Since the application is a python class, it can be enhanced with just the business logic without any operational concerns. 

  1. The packaging for distribution is done with scaffolding and writing an installer. We leverage briefcase for this step which makes it a breeze. The package must be signed before it can be deployed. 

  1. The application code can be updated and run in one step. The dependencies must be updated prior to run. 

  1. All the steps until this point can be performed on the desktop. The application can be build for phones by targeting that platform.  

  1. Once the application has been build, for that device, it can be put on the web as a web site. 

  1. Once the installer has been written, the application can be published with the briefcase command. 

Conclusion: The application can be written once. It can be deployed everywhere by targeting the build for those platforms and writing installer. The setup for the environment might take several attempts due to dependencies but writing the application is easy once the environment is up and running. 

No comments:

Post a Comment