Good morning I wanted to know if it would be possible to convert or run a script in python by converting it into an Android application, the script in question performs webscraping using selenium.
Is this possible?
They are apps like Pydroid 3 that let you run python code on an android device in more of an IDE fashion.
More to your question:
They are projects out there such as python-for-android that do as you described, however, it always recommended to use officially supported development methods for the device you want to target. (For android: Android Studio (Java/kotlin) , Flutter (Dart) etc)
Related
I have created one project in python using open-CV and I wanted to build SDK for the same project and use it in the android application directly. I have gone through a lot of links but nothing helped me. Please help me through.
I have developed an android application using java on an android studio. And now I need to implement the python script for a part of the backend functionalities. I want to access the data from our android SQLite DB to process the python scripts and return back to us some values. And on my research, I recovered a plugin named Chaquopy, but it's a paid plugin. so that I need an alternative for the same. Please suggest a tool for the same. Thanks in Advance
I'm new to Flutter and trying it for the first time (I'm not an experienced mobile developer either) and was wondering how to go about running a Python interpreter within my app.
What I'd actually like to create is an app with Python katas or challenges so that when the user solves a challenge it will tell them if it passed some tests (I assume I'd write those as unit tests).
Not sure where to start with all of that, though... I'm not even sure Flutter is the best choice, but since it sounds so promising and I can compile my app for both Android and iOS, I decided to give it a go. So any guidance on how to start building this app would be very welcome.
TL;DR: Yes, it is possible.
As there are a number of Python related apps on the Play Store, to include a full port of Python 3, I believe it is definitely possible to run Python on an Android app. The difficulty is in making it happen.
Actually creating that integration is something I am also researching. Resources I have run across so far:
Flutter packages - This is the route I am currently attempting,
so I cannot help much yet past this list
VSCode - Integration here has a learning curve (just like Android Studio) but development seems a little smoother than AS
QPython - runs Python on Android devices; no personal experience on this yet
BeeWare - again, no personal experience with this
Kivy - not an easy integration
from my experience; graphics creation is much more involved than native Android development
Chaquopy - per the developer, this is still maintained. Supports Java and Python on Android. It does have a supported chaquopy plugin, which is easier to use while integrating with flutter app.
#Floella, I have created chaquopy plugin, by using this plugin, you can use chaquopy sdk in your flutter android app. This is the video I have made that demonstrate the chaquopy plugin in action.
I am new in Python.I want to run python file(.py) on android device using Android Studio.
Any tutorial will be more useful.
Thanks in Advance.
Currently there is no such support for running Python on Android devices. Best way, currently, is to use Jython which is designed to run python in Java environment.
Is it possible to use Python to write cross-platform apps for both iOS and Android
An option is kivy: a cool cross platform Python framework which works for Android, Win7, Linux, MacOSX and iOS.
Update: kivy project is growing daily, now supports also Raspberry Pi
For Android Google provides something called ASE (Android Scripting Environment) which allows scripting languages (Python included) to run on Android. More details here
For iOS, it might be quite a bit more complicated (and I'd advise to check the latest version of iOS SDK agreement to check the current state of the law - apple tends to allow & disallow such apps periodically). For the technical part you might need to interface between Python & Objective C as well as do some wizardry to statically link all the libraries Python requires; full details are available here.
Another approach for iOS Python development would be to embed a Python interpreter into you app and distribute your Python script with it (so to play nicely with Apple rules). In this case your Python application would be a Python interpreter which is packaged with your script and runs it automatically.
Second option is to use Kivy framework(kivy.org) - it's a framework to write touch-friendly applications in Python and package them for different platforms. It's had Android support for a while, and recently added iOS support
For writing a GUI applicaion you can use the Toga library,then package it with briefcase into a Android and/or iOS app (or Windows, Linux, macOS etc).
Note: the project is still in alpha state but under rapid development.
You can try and combine brython and cordova. The Brython wiki describes how to write an Android app using Brython, which might provide the necessary information to do this also using Cordova. I haven't tested this yet, but it sounds promising. You should however be aware that due to its nature, Brython cannot support x86-compiled packages such as OpenCV (see e.g. here). On the other hand, if you know a bit about JavaScript / HTML5, you can use the WebView native functions, e.g. http://www.brython.info/gallery/three.html.
As #piertoni mentioned, BeeWare enables native iOS & Android apps to be written in Python.