App doesn't work after using Kivy/Buildozer - python

I use buildozer android debug deploy run to install my app on my android and my app installs but I can't run it on my phone
Here is my .spec file I got spam error so I send link to google drive
https://docs.google.com/document/d/1Rn1xDuWcGSvZsDVLVKeGUdwOtRtE1nNzJd91EHYmXwM/edit?usp=drivesdk
I am new to kivy and buildozer so can you tell me what I am doing wrong or what else should I attach to this post.And also I use some python build in modules in my project. Do I have to add them in requirements?

Related

How can we use Bluestacks android emulator for testing Kivy app buildozer?

I want to use Bluestacks for testing and debugging my Kivy app with Buildozer. So, please guide me how to use Bluestacks for debugging Kivy app
I'm using Google Colab for debugging If other methods are possible, please let me know
NOTE: - This method doesn't use Colab but it does allow you to use the same functionality of adb to view the log for debugging purposes
Bluestacks comes pre-installed with a debugging tool which is located in C:\Program Files (x86)\BlueStacks
I'm pretty sure that you can view the log of Bluestacks and the apps it is running using said file with the following commands.
cd "C:\Program Files (x86)\BlueStacks"
HD-Adb.exe logcat

python, kivy, geopy, buildozer

I have successfully compiled a few android packages with buildozer (e.g 'openweather' works just fine with an API key).
My Kivy file works fine.
When I include geopy, buildozer successfully compiles the kivy file, but the app crashes when I ask for the Lat/Lon position.
I have an API key from Nominatim/MapQuest:
in the 'main.py file': user_agent='API_key' or 'app_name' or my email address
in the buildozer'spec file':
requirements: pytyhon3, kivy, geopy
android.permissions= INTERNET
My question, what am I doing wrong?
Regards
Sybe
The permissions should be android.permissions = INTERNET, ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION, if you need access to the devices gps.
Try to rebuilding your app with those permissions included and post the logcat output if it still crashes

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?

Logs Generated when launching an App in Kivy Launcher on Android

I know we can launch an app in Android using Kivy launcher for android https://play.google.com/store/apps/details?id=org.kivy.pygame
and i can launch apps by the same as well . But i need to know how and where can we see the logs generated by the app in it ? For example if i run kivy app on my desktop i will be able to see logs on console but where will i find them when launching an app by kivy launcher ?
If we cant see logs is there any ways to make this possible ?
On android, kivy prints all python's normal terminal output to the android logcat stream. You can view this from the desktop by connecting your phone via usb and doing adb logcat. adb is provided by the android sdk, so if it's not in your path you can probably find it there. If you use buildozer, I think you can access its auto-downloaded android sdk using
buildozer android logcat
You can also view the adb output using some apps on the play store (may only work with older android versions though, I think something changed here).
Kivy may also store logs as text files somewhere on the sd card, possibly in the app directory (i.e. somewhere in the kivy launcher's kivy directory), but I haven't ever really used this, adb is a lot more convenient.
When your application is executed a .kivy folder will be created (if not already there).
In it you'll see a logs folder. The logs there are the same obtained via "adb logcat".

using google app engine SDK in pycharm

i'm using the PyCharm IDE, and I am trying to import webapp2 from the google app engine SDK. Since the module does not come with python, it doesn't recognize it "No module named webapp2".. I am using the pycharm community version, is there anyway around this? can I import the SDK somehow?
PyCharm Community Edition can be configured to work with Google App Engine python and hence webapp2. You won't get all the advantages of PyCharm Professional Edition such as deployment, but you'll be able to do step by step debugging and get code navigation and auto-completion working.
To enable debugging, edit the PyCharm Run/Debug configuration by setting:
Script: App Engine's dev_appserver.py
Script parameters: --automatic_restart=no --max_module_instances="default:1" .
Working directory: your base project folder (the one which contains the app.yaml file)
For more detailed instructions, explanations, and how get code completion working in your PyCharm CE project, see this tutorial.
PyCharm Community Edition does not have support for Google App Engine.
Reference: PyCharm Editions Comparison
Here's the guide which can help you to install webapp2: Quick start (to use webapp2 outside of App Engine)
Note: webapp2 is just the first step, and you will miss PyCharm integration with Google App Engine. If your project requires other Google App Engine services, consider investment into Professional version of PyCharm.
I'm using PyCharm (webApp2 library) with google app engine and I tried to found the best way for debug by python code,
that's what I found:
There is two main options:
PDB (python debugger) - GAE tool for run & debug your code which is default installed in your GAE directory (dev_appserver.py).
The tool allows you to run your program from cmd and debug it manually.
"import pdb" to your python code
use the "pdb.set_trace()" command for put a breakpoint
use cmd to run the program cd <google_appengine_dir>
python dev_appserver.py <your_project_path>
for ins cd C:\Program Files (x86)\Google\google_appengine
python dev_appserver.py C:\projects\myapp
[pbd syntax][1]
insert pdb to your python code
The second and the my preferred option is to use the pycharm build-in debugger tool. All you need to do is to use the script dev_appserver.py in the pycharm debug configuration.
Configure python GAE debugging
If you consider to upgrade to a professional version of PyCharm (or use the 30 days test-license) you can find here a guide for PyCharm showing how to create a google app engine project:
Getting Started with PyCharm as Google App Engine IDE
Before your can create the project you have to download and install the google app engine sdk depending on your platform and which language you want to use:
Download the Google App Engine SDK

Categories