python-for-android | Turn your Python application into an Android APK

 by   kivy Python Version: 2024.1.21 License: MIT

kandi X-RAY | python-for-android Summary

kandi X-RAY | python-for-android Summary

python-for-android is a Python library typically used in Telecommunications, Media, Telecom, Template Engine applications. python-for-android has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can install using 'pip install python-for-android' or download it from GitHub, PyPI.

[Sponsors on Open Collective] python-for-android is a packaging tool for Python apps on Android. You can create your own Python distribution including the modules and dependencies you want, and bundle it in an APK along with your own code.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              python-for-android has a medium active ecosystem.
              It has 7508 star(s) with 1726 fork(s). There are 348 watchers for this library.
              There were 1 major release(s) in the last 12 months.
              There are 252 open issues and 1081 have been closed. On average issues are closed in 294 days. There are 45 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of python-for-android is 2024.1.21

            kandi-Quality Quality

              python-for-android has 0 bugs and 0 code smells.

            kandi-Security Security

              python-for-android has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              python-for-android code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              python-for-android is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              python-for-android releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed python-for-android and discovered the below as its top functions. This is intended to give you an instant insight into python-for-android implemented functionality, and help decide if they suit your requirements.
            • Create an argparse ArgumentParser
            • Make a tar gz of source files
            • Get the value for a key from dist_info json
            • Make the package
            • Returns a Distribution instance for the given dist
            • Return a list of all installed distributions
            • Pretty print distributions
            • Bootstrap libs
            • Run a command
            • Build the recipe
            • Return bootstrap based on recipes
            • Locate a JDK11 installation
            • Returns the order of dependencies for the recipe
            • Builds a build directory
            • Extract metainfo files from a package
            • Create a bundle of python modules
            • Build Tensorflow Recipe
            • Build a freetype
            • Build an icu build
            • Define build variables for arch
            • Build Recipe
            • Return the recipe environment for the Recipe
            • Check the dependencies
            • Generate a biglink function
            • Build an Android Recipe
            • Prebuild pre - built kernels
            Get all kandi verified functions for this library.

            python-for-android Key Features

            No Key Features are available at this moment for python-for-android.

            python-for-android Examples and Code Snippets

            Field Lists
            Pythondot img1Lines of Code : 7dot img1License : Permissive (MIT)
            copy iconCopy
            Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
            eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
            minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
            ex ea commodo consequat.
            Duis aute irure d  
            Storage paths
            Pythondot img2Lines of Code : 0dot img2License : Permissive (MIT)
            copy iconCopy
            from android.storage import app_storage_path
            settings_path = app_storage_path()
            from android.storage import primary_external_storage_path
            primary_ext_storage = primary_external_storage_path()
            from android.storage import secondary_external_storage_pat  
            Runtime permissions
            Pythondot img3Lines of Code : 0dot img3License : Permissive (MIT)
            copy iconCopy
            from android.permissions import request_permissions, Permission
            request_permissions([Permission.WRITE_EXTERNAL_STORAGE])  
            Kivy app not working while running on samsung
            Pythondot img4Lines of Code : 2dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            requirements = hostpython3==3.7.8,python3==3.7.8,kivy==1.11.1, certifi,chardet, lxml, docutils, future, idna, Kivy-Garden, Pygments, requests, six, soupsieve, urllib3, deep-translator, arabic-reshaper, python-bidi, openssl, pyopenssl, nump
            How to build an .aab using Buildozer via Docker?
            Pythondot img5Lines of Code : 25dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            git clone --single-branch --branch feat/aab-support https://github.com/misl6/buildozer.git
            
            cd buildozer
            docker build -t buildozer-aab .
            
            docker run --interactive --tty --rm --volume "":/home
            Problem with Python, kivy application on smartphone
            Pythondot img6Lines of Code : 3dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            26860  7420 I python: ModuleNotFoundError: No module named 'PIL'
            26860  7420 I python: Python for android ended.
            
            Code worked fine, but not the app on kivy
            Pythondot img7Lines of Code : 2dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            adb logcat|findstr python
            
            Code worked fine, but not the app on kivy
            Pythondot img8Lines of Code : 3dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            # (list) Permissions
            android.permissions = INTERNET
            
            Kivymd APK App (created with Buildozer) closes after opening up
            Pythondot img9Lines of Code : 3dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            # comma separated e.g. requirements = sqlite3,kivy
            requirements = python3,kivy==2.0.0,kivymd==0.104.1,pluginname==version
            
            No such file or directory buildozer debug run
            Pythondot img10Lines of Code : 2dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            package.name = ReminderSystem
            

            Community Discussions

            QUESTION

            Buildozer could not find a version that satisfies the requirement threading
            Asked 2022-Mar-24 at 18:30

            Im trying to build my android app on buildozer but i get this error. I think buildozer can't download or can't find the threading module I researched about the error but couldn't find the solution. Can anyone help me please?

            I started the building with "buildozer android debug deploy run" code. I have done this before but it was more simple program.

            Edit: I also got same error with "time" module.

            ...

            ANSWER

            Answered 2022-Mar-24 at 18:30

            It is because threading is python's standart library. I just deleted threding from buildozer.spec "requirements" section and problem is solved.

            Source https://stackoverflow.com/questions/71549392

            QUESTION

            Kivymd APK App crashed after installing it in Android phone
            Asked 2022-Jan-31 at 09:12

            I created an APK from Python Kivy & KivyMD, using Google colab. after installing it in my phone (android) , it crashed. there two file in my project main.py, main.json, I have correctly listed Kivy & KivyMD in the requirements in the Buildozer.spec file. (kivy==2.0.0,kivymd==0.104.2) and I add json to included source like this:
            source.include_exts = py,png,jpg,kv,atlas,json

            This is my code..

            main.py: it is a simple Notes app I think that there is no error

            ...

            ANSWER

            Answered 2022-Jan-31 at 09:12

            I have also solved this problem and this helped me. Buildozer requirements is: python3,kivy==2.0.0,kivymd==0.104.2,pillow==8.0.1

            Source https://stackoverflow.com/questions/70914543

            QUESTION

            Kivy app not working while running on samsung
            Asked 2022-Jan-25 at 15:35

            I'm making a kivy app for samsung and compiling it using buildozer, ubuntu on windows.

            This is .spec file:

            ...

            ANSWER

            Answered 2022-Jan-25 at 15:35

            I had same issue in past and I solve by adding every requirements in .spec

            This requirements work for me:

            Source https://stackoverflow.com/questions/70087326

            QUESTION

            How to build an .aab using Buildozer via Docker?
            Asked 2021-Nov-26 at 13:34

            I have just seen that support for AAB files have just been introduced in Python for Android (p4a). Considering that, fom August 2021, new apps are required to publish with the Android App Bundle on Google Play, this is a crucial addition for any Python dev working on Android apps.

            Since I'm currently using Buildozer via Docker, I'd like to know which are the steps to make it generating an .aab instead of (or along to) the traditional .apk

            For the sake of clarity, here is what I use to run Buildozer from inside a container (using Docker for Windows) to make the .apk file:

            ...

            ANSWER

            Answered 2021-Nov-26 at 13:34

            The community has finally completed the AAB support for Buildozer. Although it is still a pending pull request, it is already possible to create the AAB, and I have figured out how to do it using Docker.

            I have found two very interesting gists that helped me a lot (this one about creating an AAB with Buildozer on Ubuntu, and another one about signing an AAB on the same platform). However, I have run everything on Windows via Docker, so I think it is a good idea to share how I did it.

            1. Clone the feat/aab-support branch of the Buildozer repository in your local machine:

            Source https://stackoverflow.com/questions/69149494

            QUESTION

            Can i connect a python server with a kotlin client?
            Asked 2021-Nov-13 at 09:52

            I'm making a cryptocoin app with my friends and i used to make app with python until i got several error on buildozer and python-for-android for days. I can't build apk so i decided to switch to kotlin and curious about something. This app will run with help of a python bot which is running on a server. Can i connect a python server with kotlin client and dump json data sended from python server?

            ...

            ANSWER

            Answered 2021-Nov-13 at 09:52

            Yes you can. You can consume APIs with Android Retrofit library. In Google official docs you find a codelab on how to use it.

            Source https://stackoverflow.com/questions/69950684

            QUESTION

            Code worked fine, but not the app on kivy
            Asked 2021-Oct-23 at 13:42

            I am trying to create a kivy app for android device. And my code is working great on the PC. But the apk file created using buildozer is not really working on the android. It crashes before opening. But a simple Hello World Example works perfect With the same spec file.. I am not at all using any external modules in the app. Only socket module (which is a python core module.)

            I don't know, what is happening. So I used socket to create a functionality to try the code and in exception I have given the code to send the Exception to my IP. Also I am having a program ready to receive and print the signal. Both these things worked great on the PC. But apk still crashes. Without sending any logs to my PC.

            Here is the spec file:

            ...

            ANSWER

            Answered 2021-Oct-21 at 04:06

            Remove comment from android.permissions = INTERNET,
            then it may work.

            Source https://stackoverflow.com/questions/69650829

            QUESTION

            Kivymd APK App (created with Buildozer) closes after opening up
            Asked 2021-Oct-16 at 12:52

            I have created an APK file from Python Kivy & KivyMD, using Buildozer. When I open the app after installing it, it shows the splash image and then closes. I have checked and found that their seems no issue in the main.py, as I have correctly listed Kivy & KivyMD in the requirements in the Buildozer.spec file. (kivy==2.0.0,kivymd==0.104.1)

            This is my code..

            main.py

            ...

            ANSWER

            Answered 2021-Oct-16 at 08:18

            If you have some other plugins just add them like this:

            Source https://stackoverflow.com/questions/69593107

            QUESTION

            why are not showing after app in android?
            Asked 2021-Sep-27 at 11:28

            from kivy.uix.screenmanager import Screen from plyer import call from plyer.platforms.android import activity from kivy.utils import platform import os

            ...

            ANSWER

            Answered 2021-Aug-25 at 14:54

            plyer call method works only on android and iOS as descripted here here

            Source https://stackoverflow.com/questions/68924221

            QUESTION

            No such file or directory buildozer debug run
            Asked 2021-Sep-27 at 05:57

            I encountered an error while trying to compile my kivy app using buildozer. It's telling me no such file or directory. When I went to check the directory it's Reminder__armeabi-v7a/project.properties but it seems it needs the directory as Reminder system__armeabi-v7a/project.properties. I don't know if it's advisable to rename the directory because I didn't create the directory. It was created automatically during the build process. Also when I tried renaming the folder to "Reminder system__armeabi-v7a/project.properties", I got the error saying "toolchain.py: error unrecognized argument system system", so I reverted the changes made, and I'm looking for another solution.

            My buildozer.spec file looks like this:

            ...

            ANSWER

            Answered 2021-Sep-27 at 05:57

            I'm not familiar with buildozer, but the path in your error message contains a space, which is suspicious (unfortunately, many tools still fail to work with spaces in the path...). It seems to come from your package.name variable in the buildozer.spec, which is "Reminder system".

            Simply renaming directories that you didn't make yourself is generally a bad idea. I'm glad you reverted that action.

            The documentation of buildozer.spec states this:

            The Package name is one word with only ASCII characters and/or numbers. It should not contain any special characters. For example, if your application is named Flat Jewels, the package name can be flatjewels.

            So I guess that changing that line to:

            Source https://stackoverflow.com/questions/69329650

            QUESTION

            Kivy app on android network issue, Permission denied
            Asked 2021-Sep-23 at 18:46

            I'm trying to make kivy app for android that has some simple network features. The app works fine on pc but when I try to import it to android it doesn't work anymore. At first my app crashed on startup which was apparently caused by having network stuff on my main thread so I moved all the network stuff to another thread so my app doesn't crash anymore but it doesn't work either. Here is where I make new thread for networking:

            ...

            ANSWER

            Answered 2021-Aug-12 at 12:25

            You don't need android.permissions in your requirements, but you will need the line:

            Source https://stackoverflow.com/questions/68753183

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install python-for-android

            You can install using 'pip install python-for-android' or download it from GitHub, PyPI.
            You can use python-for-android like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            Follow the [quickstart instructions](<https://python-for-android.readthedocs.org/en/latest/quickstart/>) to install and begin creating APKs.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
          • PyPI

            pip install python-for-android

          • CLONE
          • HTTPS

            https://github.com/kivy/python-for-android.git

          • CLI

            gh repo clone kivy/python-for-android

          • sshUrl

            git@github.com:kivy/python-for-android.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link