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
Related
I have a chatbot application that has backend modules coded in Java, AI features implemented with Python coding and frontend in ReactJs. My problem statement is:
The chatbot is such that it can be placed onto websites, but now I need to find a solution, how can I install this chatbot in an android app/iOS app? Perhaps, it is through an SDK.
I searched over multiple places but couldn't find an answer to how can I build an SDK including all these modules of different coding languages under one structure? Each of the modules have their own dependencies and not that the same module has been coded in a different language.
Need help here.
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.
I have a Python web application that I want to wrap in Electron. The web application backend is a very slim Flask app that forwarded calls to a Python package that does the processing, and formats the results. We have a React frontend that talks to this backend. We also have a pip based installation, that runs the Flask backend and serves the frontend, so you can pip install run the server and use it from your browser. This is similar to how Pgadmin 4 works.
Since this application is only used by people on their own computers, and never installed on a server, I want to convert it into an Electron app. However, I couldn't figure out how to distribute this application in one setup for Windows, MacOS and Linux. I don't want the users to have to install Python on their computers.
How can I do that?
There is a couple of clues on how to do that, even though I'm still unsure whether all necessary python modules can be bundled easily.
I have a similar case, even though I just want to bundle a prototype in an electron application so I can send it to collaborators for evaluation, without any intent of shipping it to final users.
My list of hints:
https://github.com/matbloch/electron-flask
https://efficientcoder.net/connect-python-3-electron-nodejs-build-desktop-apps/
https://www.techiediaries.com/flask-electron-tutorial/
I really don't see why you need to throw electron in the mix, instead of just using your browser. I reckon that a barebone electron app that serves your page in a single window is going to be 50Mb. The key benefits of electron is that it lets you do system calls (access local files / devices), but if you are running flask you already have this ability.
Your main obstacle is how to distribute the flask app, specifically without installing python - and electron is not going to make things any easier to that respect. You should probably look at pyinstaller which lets you create executables that embed python.
Now, if you're talking of getting rid of python altogether, then indeed you could do that, nodejs has a rich set of libraries for everything os / db-related, even image processing, but it will lack in data science and processing. YMMV.
I have created one project which has machine learning and Signal processing functionality.
This project is running on server without any issue. My android device making API call to server and getting response.
I want this functionality to be run offline (Without Internet) without calling to remote API.
What are the possible way to run to Python functionality in the Android application?
Writing entire application in Java is not feasible because it depends on many python libraries like numpy, scipy, pandas, sklearn etc.
Maybe you can use Termux which is an Android terminal emulator and Linux environment app.
It comes with a package manager pkg which can be used to install Python.
pkg install python # or python2
It installs python and the pip package manager.
You can also find some useful information in wiki.python.org/moin/Android.
You can try Chaquopy, it allows intermixing of Python, Java and Kotlin. Furthermore it allows the use of cheeseshop (PyPi) packages such as the one you described.
You should be able to integrate your existing code with a Java application for Android.
https://chaquo.com/chaquopy/
It requires a commercial license if you don't want to opensource your code.
It is possible to use python for android project https://github.com/kivy/python-for-android. For rooted device or system app it is possible to launch python interpreter (compiled binaries) as a separate process with script as a parameter
I'm writing a web application in Python, intended for use by teachers and pupils in a classroom. It'll run from a hosted website, but I also want people to be able to download a self-contained application they can install locally if they want more performance or they simply won't have an Internet connection available in the classroom.
The users aren't going to be able to manage instructions like "first install Python, then install dependencies, download the .tar.gz archive and type these commands into the command line...". I need to be able to create an all-in-one type installer that can potentially install Python, dependencies (Python-LDAP), some Python code, and register a Python-based web server as a Windows Service.
I've had a look through previous questions, but none quite seem relevant. I'm not concerned about the security of source code (my application will be open source, I'll sell content to go with it), I just need non-technical Windows users to be able to download and use my application with no fuss.
My current thoughts are to use NSIS to create an installer that includes Python and Python-LDAP as MSIs, then registers my own simple Python-based web server as a Windows service and puts a shortcut in the start menu / on the desktop linking to http://localhost. Is this doable with NSIS - can NSIS check for currently installed copies of Python, for instance? Is there a better way of doing this - is there a handy framework available that lets me shove my code in a folder and bundle it up to make an installer?
Using NSIS is great (i use it too) but i would suggest using a "packager" like pyinstaller (my personal fav, alternatives bb_freeze, py2exe) to create an exe before the using NSIS
The primary benefit you get by doing this is;
Your download is smaller as you're not bundling the whole Python Standard Lib and extra stuff your app wont need and you get an exe file to boot!
You can try the Bitnami Stack for Django that includes Apache, MySQL,Python, etc in an all-in-one installer. It is free/open source