How to write android applications in python on an android device? - python

I am currently learning Python as part of my job and was interested in the possibility of creating android applications using what I am learning. Unfortunately I only have access to a computed at work and the system is pretty locked down in that I cannot export work I create etc and the only device I have during my leisure time is my android phone.
I have heard about the possibility of using Kivy but have only seen reference to this being used on MacOS, Linux or Windows making me think my only choice would be running a virtual machine which would be less convenient than running a native tool. I have also seen that AIDE is a great tool for android app development on mobile but can only be used with C++/Java which would involve learning additional languages and PyDroid3 being a great python tool but don't know how this could be used to create android apps.
Any experience or knowledge in this area would be much appreciated. I understand the best scenario would be to either buy a laptop/pc and use PyCharm and/or Kivy or to learn Java and used the official Android development suite but in my current situation this is not possible.

Just download pydroid3 from play store and follow the steps to create an android app.
Install kivymd module using pip in pydroid3.
Watch kivymd tutorials on youtube to learn kivymd module , you can also refer to kivymd documentation on google.
Develop application using kivymd module in pydroid3.
Convert your python file to apk using kivy buildozer in google colab in chrome on your mobile phone.

I haven't used kivymd but I have used kivy in pyroid3 and it works really well on a phone. Also when you run the code it gives a really good indication of how the final app will look on the phone. But that said I have only used Buildozer to compile the .APK and this only works in Linux so for me that ment virtual Linux system.

Related

Is it possible to run code without gui on android?

I got python code that has no GUI and works in terminal. Can I convert it to apk and run on android?
I'm just curious if it's possible.
No, you cannot directly run a Python script in the terminal as an Android app. Python scripts are typically run on a computer using the Python interpreter, and Android devices use the Android operating system which is different from the typical computer operating systems.
However, you can use a tool such as Kivy, which is a Python library for creating mobile apps, to create an Android app from your Python script. Kivy provides a way to package your Python code into an Android app, so you can run it on an Android device.
I am sure there are other tools providing this option as well. These tools essentially bundle the Python interpreter and your script into a single executable file, so the user doesn't need to have Python installed on their device to run your app.
I believe there are tutorials on youtube as well so as to how to use Kivy to run your python code. I hope this helps :)

create android, iOS libraries from python, including dependencies

We working on a project which involves ML/AI integration to the native mobile application. We are programing our ML/AI code in python. Python code has dependencies, that we need to include in our mobile application.
We have tried with kivy but they only create .apk files and apk files can't be called from other apks. So, we need to create libraries that can be included in the android and ios projects.
Also, we tried chequopy but that doesn't support mediapipe which is in heart of our implementation.
Any guidance in that direction will go long way for us.
If your app was entirely self-contained in python including dependencies using recipes should be possible. If rewriting the native app is not an option maybe one idea is to serve the ML over an HTTP API running on a local server (eg flask). Quite cumbersome as users would need to install two apps

How to package a Kivy application for Android from a Windows machine?

So I was following along this Python tutorial teaching how to make a mobile app using Kivy, and at the end they used Buildozer to package it for Android. I discovered that Buildozer doesn't work for Windows. I tried looking for other ways, but have not found any straightforward way that works for Windows.
Would anyone be able to link me a relevant instruction page or explain how can I package my Kivy app for Android from a Windows WITHOUT using a virtual machine?

Python kivy for cross-platform apps

Good day
I want to build cross-platform mobile app with python kivy.The problem is that I don't have mac to test project on ios emulator.Do you have any idea.Or can i just test it only on android phone and will it work the same in iphone?
i have used kivy before, sometimes the code runs well on a platform don't guarantee that it will do the same in another, so it is always a good practice to test your app on both platform. if you don't have access to a mac, i recommend you using services such as MacInCloud VirtualMacOSX XCodeClub or other alternatives to test and build your app for ios. (if you are lucky you may find free trial on some of the alternatives)

building apps with kivy to intract with Django Restframework

so I have a project that developed with django ,Django Restframework.
I had planned for UI handling. Reactjs and Reatnative for UI .but I searched and found Kivy project that comes with Cross Platforms for making Apps and games.my project doesn't involve any game stuff just regular web site.
is it good using kivy for handling UI for Android and IOs?
I also checked kivy supports fully Url request for interact with Rest APIs.
https://kivy.org/docs/api-kivy.network.urlrequest.html
Kivy is really good alternative to android native programming language for python programmers. You need ubuntu to build apk for kivy apps. However, installing ubuntu or virtual environment is not mandatory if you use windows 10 because windows 10 have linux subsystem. You can check it on this videoVideo.
Kivy is general framework which is not specific to games or graphical application only. Kivy support regular mobile application development, we can check it by the provided widgets. The widgets are also customizable So, kivy is a pretty good alternative.

Categories