Sunday, August 25, 2013

Installing Pygame Subset for Android


I noticed that a new version of pgs4a came out.  I upgraded from 0.9.4 to 0.9.6 this morning.  The process went smoothly on my Ubuntu 12.04 LTS system.  I was up and running in 10 minutes and my programs ran with no problems.

Since the installation on Linux normally goes fine, I suspect that many of the problems people have with pgs4a is not due to the installation, but due to usage.

Here are three common problems I've heard about:

1) You're not specifying the directory of your application.  Many people will configure and build the name of the python file.  This is wrong.  You need to specify the name of the directory.


The location specified after build is the name of the directory, not the file.

2) You didn't name your main python file main.py.   You may have called the file something like runner.py or angryfish.py.  This is wrong.  The file needs to be called main.py.

3) You didn't initialize the android library in  your python code.


Then, there are cases where everything should be working, but it's not. Assuming that you installed the android sdk with the command.

 then your adb tool will be in android-sdk/platform-tools.

The most useful command will be ./adb help followed by ./adb logcat.   With your phone connected to your computer with a USB cable, running ./adb logcat will give you the logs from your phone.  By reading through the logs, you should be able to get some clues as to why your program is failing.




3 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. Hi im having this error: IOError: [Errno 2] No such file or directory: '/rapt-master/res/values/strings.xml' while building
    Can you help me out please.

    ReplyDelete
  3. Good, could make a video tutorial updated pgs4a for 32bit linux please, I've been trying to do multiple .apk following tutorials on the web but I always generate errors, please such a tutorial would be helpful, thanks.
    the error generally occurs with a file buil.xml

    ReplyDelete