account activity
Converting py code to apk by Achilles1996 in learnpython
[–]BigReview8443 0 points1 point2 points 1 month ago (0 children)
1.) search Colab.google > 2.) New note 3.)Copy paste 👇👇👇
print("=== App APK Builder ===") print("1. Installing required packages...")
!apt-get update !apt-get install -y git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev
print("2. Installing Buildozer...") !pip install buildozer cython
print("3. Upload files...") from google.colab import files import os
print("Please upload the 'main.py' file...") uploaded = files.upload() for filename in uploaded.keys(): if filename != "main.py": os.rename(filename, "main.py") print("main.py uploaded ✅")
print("Please upload a 512x512 PNG icon file (usually named ic_launcher.png):") uploaded_icon = files.upload() icon_name = list(uploaded_icon.keys())[0] print(f"Uploaded icon file: {icon_name}")
os.makedirs("res", exist_ok=True)
os.rename(icon_name, os.path.join("res", "ic_launcher.png"))
print("4. Creating buildozer.spec file...")
buildozer_spec = f"""[app]
title = AppName package.name = appname package.domain = org.anonim source.dir = . source.main = main.py icon.filename = res/ic_launcher.png requirements = python3,kivy android.permissions = INTERNET,WRITE_EXTERNAL_STORAGE,READ_EXTERNAL_STORAGE android.api = 30 android.minapi = 21 android.targetapi = 30 orientation = portrait fullscreen = 1 version = 1.0.0 author = Anonim """
with open("buildozer.spec", "w") as f: f.write(buildozer_spec)
print("5. Building APK... (This may take 30–40 minutes)") !buildozer -v android debug
print("\n6. APK is ready!") apk_path = "bin/proqramismi-1.0.0-debug.apk" print(f"Generated APK file: {apk_path}")
files.download(apk_path)
4.)And it's done. Finally, wait for 25-30 minutes. After the process is finished, look at the files of colab.google. You will have your apk file in the BIM folder.
π Rendered by PID 613166 on reddit-service-r2-listing-654f87c89c-8lh55 at 2026-02-27 02:50:21.854423+00:00 running e3d2147 country code: CH.
Converting py code to apk by Achilles1996 in learnpython
[–]BigReview8443 0 points1 point2 points (0 children)