Using pygame on buildozer to build apk does not work - pygame

I am trying to build an apk using buildozer using pygame. Although buildozer is mainly used for kivy apps but think it should work using pygame also. But my apk created does not run on phone.
So are there some dependencies required to use pygame? Or should I use pygame_sdl2 (is pygame not for Android?) Or should I use pygame along with kivy? If that is the case, how can I do that?

Buildozer/python-for-android do not support pygame. Even when we maintained the pygame bootstap, it probably didn't work well for normal pygame apps - rather it was a modified version used only as a Window backend for Kivy.
pygame_sdl2 should work, but python-for-android doesn't currently have a build recipe for it. It should be pretty easy to add one if you want to look into it.

Related

Is There a Way to Convert PyGame Projects to HTML [duplicate]

I have 3 game libraries installed on my PC: pyglet, pygame and Panda3D.
I would like to create a 2D game and make it a web browser game so i can put it on facebook.
I know that Panda3D has a web-browser-plugin. Panda3D is for 3D games mainly.
Therefore, I'm asking, is it possible to play a pyglet or pygame game in a browser? If not, what Python library do you recommend?
Neither pyglet nor pygame will run in a browser. I wouldn't really recommend using Python at all if you target is a web browser. JavaScript (with HTML5 Canvas), Flash, or Java applets are is better suited for that environment.
If you're dedicated to the idea of using Python, there are a number of projects that can compile Python into JavaScript. There are some mentioned on the Python wiki. Here are a few:
Skulpt
Pyjamas
Pyjaco
You'll need to write your own graphics and audio systems, though, since none of those projects can convert the native code needed by pyglet and pygame into JavaScript.
It requires a bit of reprogramming, but i made a pygame library "port" to the browser/nodewebkit using Brython and GameJS. You can program using a version of pygame and python 3 in the browser. You can check it out at https://github.com/asherwunk/pygjs
An option is to use repl.it. It allows creating Python/PyGame scripts and multiplayer coding. When creating a new repl, select the Pygame template:
Example: repl.it/#Rabbid76/PyGame-TransparentShapes
Today, i'd recommand using pygbag https://pypi.org/project/pygbag/ from https://pygame-web.github.io. It uses the same principles from Panda3D webgl port ( not the old plugin) using Web Assembly for modern browsers.
I just found this website https://trinket.io/features/pygame that allows you to run pygame from this website! But it's extremely slow. It should work from your browser but it'll take forever to run it.

Using cocos2d-x as a static library results in linker errors on mac os

I am trying to use cocos2d-x as a game engine, and I have already tried using RubyMotion and MonoTouch to check if it is possible to use cocos2d-x binaries.
But both, RubyMotion and MonoTouch, are suffering from the same linker error:
duplicate symbol _SHA1 in:
libcocos2dx.a(sha-1.o)
libcocos2dx.a(sha1_one.o)
I did a research and figured out following:
_SHA1 symbols are defined in libcurl.a which packed as precompiled static library inside of cocos2d-x externals. During building cocos2d-x XCode calls libtool to create a universal binary libcocos2dx.a And according to this article libtool itself creates duplicated symbols (in some cases related to category bug).
Though author states how he has solved similar problem in his case, I am not sure how to apply his solution to my case (if at all it can be applied).
I am not sure where to go from here, since I hoped to use either Ruby or C# to develop my game. Is it possible to solve this libtool/linker problem and get static library without duplicated symbols?
P.S. Please note that if I use same cocos2d-x binaries as a xcode project inside my XCode project, then everything is good. But I want to code in ruby/c#.
As an option you could use project template for MacOS which comes with cocos2d-x samples. We've made several projects (two of them are already at the store) this way.

Standalone actionscript interpreter?

I want to to play around with Actionscript, mostly to compare the language with Javascript (I'm interested in the type system). Is there a straightforward way to do that or do I need to also install Flash or something similar? I'd prefer something that works on Linux but Windows-only is fine too.
Basically, I want to know if there is something for Actionscript that is analogous to v8/NodeJS or Rhino for Javascript, where you can run JS scripts directly (using console.log for output) without having to use a browser, create an HTML page, etc.
There is an amazing online tool capable of compiling Actionscript 3.0, this will aid your investigation of the language!
http://wonderfl.net/
As3Eval also is a good tool. Play around with the demo to get a feel for it.
It's windows only, but download Java, then install FlashDevelop : http://www.flashdevelop.org/
It'll download the flex sdk and everything you'll need to get started.
You'll need flash player to see your tests, and normally the debug player (take the standalone), which you can download here: http://www.adobe.com/support/flash player/downloads.html
As #neil says, you can also use wonderfl to test directly online, though obviously the experience won't be the same as a full ide.
You should be able to develop on Linux directly if you want to install flash builder (eclipse) but it's not free

QJSon in Qt4.7 - how to install/use

I'm using Qt4.7 on a Windows machine. I can't update Qt to version 5 and I'm unable to install CMake.
I need to use QJSon for a project, but it seems to be only available natively on Qt5+. Can anyone instruct me on how to "backport" it or something?
I also found this class for JSON handling that might serve the same purpose. If I wanted to use it instead, do I only need to import it to my project?
Please escuse me if this is all too simple/evident, but I'm new to desktop development, I only have some experience with webdesign, so any help is welcome. :)
Whilst you could attempt to backport QJson you're best off going for the second option, simply for ease. All you need to do is bring the files into your project, if you're using Qt Creator when you do 'Add existing...' it should automatically add the include and header to the compilation phase. If it doesn't you add them to the .pro file so the compiler knows what it needs to include.

Using stl in an Android adb shell native program

I'm trying to port a C++ utility program that I want to be run from the Android ADB shell.
For that, I'm using the Android NDK's make-standalone-toolchain.sh script, and compiling my program with it.
Unfortunately, when I try to run it, I get this error:
reloc_library[1315]: 16304 cannot locate '_ZNKSs5c_strEv'...
CANNOT LINK EXECUTABLE
After some research, I saw that this means that the c_str function doesn't exist in libstdc++.so in the NDK. I also couldn't find the symbol in stlport.so either, and actually only found it in the ./sources/cxx-stl/gnu-libstdc++/libs/ version of the C++ libraries. These libraries are not included in the standalone toolchain I made, and I also couldn't find them on the device (the device is running Honeycomb).
The text in the NDK clearly states that there's support for the entire STL when I use stlport. Is this something that is only true in Ice Cream Sandwich? The libstlport.so or in libsupc++.so on the device and in the NDK didn't have any signature like the one that wasn't found.
So my question has two parts:
Is there something I'm missing in the build process/Android setup? Can I set up things differently so that the program will compile without needing the gnu-libstc++, or at least fail with a compilation/link error instead of failing to load on the device?
If linking with gnu-libstc++ is the only way, how can I do that? I think I can manage statically link to it but I'd rather not.
How can I add the gnu-libstdc++ version to my
If someone else is looking for a solution, I ended up adding a dependency using the -l switch on libgnustl_shared.so. You can find it inside the NDK at
sources/cxx-stl/gnu-libstdc++/libs/&ltarchitecture&gt/
I then pushed this .so together with the program to the device, and made a script that adds the current directory to LD_LIBRARY_PATH. It seems similar to what the NDK does when you use the make scripts to create a program that depends on gnustl.