Recently I followed a Kivy tutorial, and I made a calculator. I then wanted to use it on my phone, so I used Kivy Launcher. The problem is, it only uses Python 2, which for some reason, didn't have support for Unicode characters. Also, a lot of the syntax was very different, so I had to change a lot of the code. Just so I could test it out on my phone.
Is there a Python 3 version for the Kivy Launcher? I've seen things like https://github.com/kivy/python-for-android/issues/1638 but how do you build it? I've ran setup.py and I got a .egg file. What do I do with it? Do I have to make an APK using python-for-android or buildozer?
Also, a lot of the syntax was very different
I think it would be more accurate to say that a small amount of the syntax was somewhat different.
The problem is, it only uses Python 2, which for some reason, didn't have support for Unicode characters
Python 2 did have support for unicode characters, although the subtleties around how they're handled are one of the real differences between Python 2 and 3.
Is there a Python 3 version for the Kivy Launcher?
It's possible to build a Python 3 version of the old launcher, or the new one that you've found. However, in both cases if you can build the launcher you could also just build a standalone apk, so you probably may as well follow the instructions to build your own app with buildozer.
I've ran setup.py and I got a .egg file. What do I do with it? Do I have to make an APK using python-for-android or buildozer?
It sounds like you've built a desktop package for the launcher, if you want to build an apk you must indeed use those projects.
I've figured out some ways to achieve what I wanted.
Get Pydroid 3. Install kivy using Pip and just run it.
Use buildozer to build the Kivy Launcher. Then I can test out some code without building it all.
Use VirtualBox to build. Download a version of Ubuntu/Lubuntu and build the APK.
Related
Recently I've been working on a project that involves a phone taking a picture, processing it in some way, and returning the output on the screen. In order to do this, I would have to use openCV, but when I try to "import cv2" in the Kivy code using the launcher, the app crashes immediately after I run it. I realize now that the reason this happens is because the Kivy launcher by itself can only do basic functions like print and such and there must be extra steps needed to use external libraries. I tried to use Buildozer to create a package for android, but soon found out that it only would work for linux computers, while I use Windows.
Essentially, my question is: Is there any way to include an external library in Kivy without using buildozer? And if there is, could you please describe it or post a link to a webpage that contains instructions(as I am fairly new to programming and am somewhat of a noob)
Thanks!
You can try python-for-android.
But the easiest way - install virtual box to your PC, download kivy/buildozer for VirtualBox( it calles Virtual Machine (for Android/buildozer)) here below: https://kivy.org/#download and then just connect downloaded vmdk-disk to VirtualBox, and then use this. Everything is prepared, you don't need to install kivy or buildozer.
You will spend about 30-40 minutes.
I'm trying to compile an Andriod apk file with a more recent version than what Buildozer uses by default (2.7.2).
Reason being, I have a library that needs 2.7.7 or greater, and I'm not that confident in creating a full Python build myself with a specific lib. The app runs perfectly on my Linux PC which runs 2.7.12.
Using Python 3.5 with Crystax gives me more problems again. (I will try again if the solution above is not possible.)
Is this impossible, or too complex for someone who is 'Python intermediate'? Any help is appreciated.
Edit: OK, looks like I need to compile a python for android from a repository from github. Annnnd..... the fun begins!
The code used to compile python2 is in the recipe here. Targeting a different python version would require updating all the patches and potentially making other changes depending on what is necessary for compatibility.
There was a PR for this at https://github.com/kivy/python-for-android/pull/775, which may be a useful reference. I don't know if it will work easily.
Going the python3 route with crystax is probably easier.
Hi I'm trying to write two python scripts for one project. My goal is to have the front end of some analysis done in python3 with the output of many text files (completed). The back-end of analysis will read text files and interface with PyMOL, which is python2 dependent (which I did not realize). Using Xcode, or something else if Xcode is poorly equipped for this, can I run my 2 scripts consecutively as one project? Conceptually this seems simple but I have been unable to manage it.
Essentially I would like this in Xcode:
Project
Python3 script
Python2 script
Any help would be great.
Xcode is not a Python IDE*. It can open and edit Python files, but that's about it. Previous versions of Xcode included support for many programming languages, but now it is limited to just four: C, C++, Objective-C, and Swift. I recommend that you download a Python IDE instead of Xcode. There are many to choose from, and most run on Mac.
* - Well, technically you could set up Xcode to run Python by setting up the project to use an external build system. But that's like using a nuke to swat a fly -- you should use dedicated Python tools instead.
I'm trying to install kivy to make an application for android and ios.
I have installed the portable app as per the website but wanted to have it included in my python Idle.
So I searched and found Kivy-1.8.0.win32-py3.4.exe installs it ontop of your python instalation (C:\python34)
When i try and import i can import kivy but it wont let me install App or recognise UIX.
I have looked around and I think that my issue is with pygame, every time i try to install it i get missing files and that is with pip and a pygame-1.9.2a0.win32-py3.2.msi that i found but still nothing!
Also read it might be cython and i installed that too downloading Cython-0.21.1 andtrying to run the instaltion on that.
Is there a way to get this done without a headache?
Do i need kivy to make an app for android and ios or can i use tkinter? (thats works on my pc lol)
please any advice would be great, I have searched but all the information out there is very disjointed and im hoping to find a one stop answer in one of you guys.
thanks
Raif
Do i need kivy to make an app for android and ios or can i use tkinter? (thats works on my pc lol)
You need kivy (or maybe some other python tools, but I don't think any are remotely as good). The android build tools only work on linux or osx, though you can use a virtual machine for it.
If you installed from the popular unofficial windows binaries site, make sure the version matches your python version, and you probably need to get pygame from the same place. I don't know much about this though.
Linux is the best python development environment. Python on Windows is very very buggy with certain packages due to compatibility issue. Many important development packages in python are optimized for Linux. You get rid of all headache by downloading and installing a lightweight Linux like o. So like back box on a virtual machine.
If your goal is a Kivy app for iOS and Android, you have already made several mistakes. The first is that you cannot create an iOS app from any OS except OSX. There's no way around that. The second is that the tools for compiling for Android and iOS only work with Python2.7 currently. You seem to be using Python 3.4.
I wanna know if i can use buildozer for non-kivy python scripts. Is it possible to build apk files from ordinary python scripts other than kivy scripts?
I would say that it probably isn't possible. However, you should ask in the kivy support group. You need to join it to post. Some people there really seem to know their kivy, and in my experience, I haven't had to wait too long for answers.
EDIT:
If you look in the buildozer.spec file of your project, you will see the following lines are included by default:
# (list) Application requirements
requirements = kivy
While this makes it seem like kivy may be a requirement for all projects with buildozer, you could try commenting out the requirements or something and see what happens when you try to compile code without kivy.
Or since that is a bit of a backwards way to do it, as you would have to have already created your buildozer.spec file. Perhaps you could just try using buildozer on a project without kivy and see what happens.