Compare commits

...

7 Commits

Author SHA1 Message Date
Tom Rothamel 2c728bc9a4 Bump version. 2012-09-11 01:28:40 -04:00
Tom Rothamel a573008ef1 Ignore attempts to play None as sound/music.
This is a minor behavior change. Before this, renpy.play would stop
the playing sound if called with None - which is the default in a lot
of circumstances.
2012-09-09 22:47:23 -04:00
Tom Rothamel 72a8e029ad Fix RAPT docs. 2012-09-04 22:29:38 -04:00
Tom Rothamel 4142473dc0 A few more fixes to the Android packaging docs. 2012-08-28 20:16:14 -04:00
Tom Rothamel 6e2bb81a1c Merge remote-tracking branch 'remotes/ren/patch-3' 2012-08-28 19:42:32 -04:00
Tom Rothamel dd4fc916ec Remove unnecessary use of AVFormatParameters in dead code. 2012-08-28 19:13:25 -04:00
xRenx 8e755eb157 Update sphinx/source/android-packaging.rst
Changed some wordings, expanded on some points, added screenshots and a Troubleshooting section.
2012-08-27 19:28:21 +02:00
11 changed files with 190 additions and 32 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
init -999:
$ config.script_version = (6, 14, 1)
$ config.script_version = (6, 15, 0)
-3
View File
@@ -1152,7 +1152,6 @@ static int decode_thread(void *arg)
AVFormatContext *ic;
int err, i, ret, video_index, audio_index;
AVPacket pkt1, *pkt = &pkt1;
AVFormatParameters params, *ap = &params;
int codecs_locked = 0;
// url_set_interrupt_cb(decode_interrupt_cb);
@@ -1162,8 +1161,6 @@ static int decode_thread(void *arg)
is->video_stream = -1;
is->audio_stream = -1;
memset(ap, 0, sizeof(*ap));
is->io_context = rwops_open(is->rwops);
codecs_locked = 1;
+1 -1
View File
@@ -36,7 +36,7 @@ except ImportError:
#
# Be sure to change script_version in launcher/script_version.rpy.
# Be sure to change config.version in tutorial/game/options.rpy.
version_tuple = (6, 14, 1, vc_version)
version_tuple = (6, 15, 0, vc_version)
# A verbose string computed from that version.
version = "Ren'Py " + ".".join(str(i) for i in version_tuple)
+1 -2
View File
@@ -67,8 +67,7 @@ def play(filenames, channel="music", loop=None, fadeout=None, synchro_start=Fals
raise Exception("Can't play music during init phase.")
if filenames is None:
filenames = [ ]
loop = False
return
if isinstance(filenames, basestring):
filenames = [ filenames ]
+180 -22
View File
@@ -1,3 +1,5 @@
.. highlight:: none
Building Android Applications
=============================
@@ -23,8 +25,9 @@ Building your first package takes four steps:
install the package on your device.
Once you've finished these four steps, you'll have a runnable Android
package. You'll then repeat steps 3 (rarely) and 4 (often) until you
your game works.
package. You'll only need to run step 3 when you decide to make changes to your
game's configuration or when configuring a new game entirely; you'll run step
4 most often, whenever you need to make a new build of your game.
Host Platform Support
@@ -34,8 +37,8 @@ We've tested |PGS4A| on Linux and Windows computers. While it should
work on Mac OS X, we haven't tested it there, so there may be problems
encountered. The examples we give will be for Linux and Windows.
The |PGS4A| tools are command-line based. This documentation assumes
that you are proficient with the basics of command-line operation.
The |PGS4A| tools are command-line based. We will try to assist you with
examples to familiarize you with the command line on Windows.
Step 1: Installing |PGS4A| and its Dependencies
@@ -44,7 +47,6 @@ Step 1: Installing |PGS4A| and its Dependencies
There are four things you may need to manually download and install
before you can run |PGS4A|:
**Java Development Kit.**
The Java Development Kit (JDK) contains several tools that are used by
|PGS4A|, including the tools used to generate keys and sign
@@ -66,8 +68,8 @@ included with |PGS4A|. It can be downloaded from:
**Android Device Drivers.**
On Windows, you will likely need to install a device driver to access
your device. Links to android device drivers can be found at:
On Windows, you may want to install a device driver to access
your device, although this is not necessary. Links to android device drivers can be found at:
http://developer.android.com/sdk/oem-usb.html
@@ -79,10 +81,18 @@ your device, you may need to read:
However, modern versions of Linux and OS X should just work.
**Itself.**
The latest version of |PGS4A| can be downloaded from:
.. ifconfig:: is_renpy
**RAPT Itself.** The latest version of |PGS4A| can be downloaded from:
|PGS4A_URL|
.. ifconfig:: not is_renpy
**PGS4A Itself.** The latest version of |PGS4A| can be downloaded from:
|PGS4A_URL|
|PGS4A_URL|
Once |PGS4A| has been downloaded, you should extract it using an
archive program. The directory contained in that archive is what we
@@ -99,23 +109,70 @@ you're on.
In all cases, you should run ``android.py`` from within the |PGS4A|
directory. (That is, the directory containing ``android.py`` itself.)
On Windows, if the .py extension is registered to Python 2.7, you can
On Windows, to do this, you will need to open up the command line by pressing
and holding down the Windows key and 'R'. In the small window that pops up
write "cmd" and press Enter. This should bring up the command line.
To run the command from within the |PGS4A| directory you need to navigate to it
from the command line. Find out where you extracted |PGS4A| and copy the path
from Explorer (just click in the address bar so the path turns blue and
press Ctrl+c). In the command prompt, write ``cd`` then a space, a
double-quote, paste the path you just copied from Explorer (right click and
choose ``paste``), then another double-quote.
.. ifconfig:: is_renpy
Let's assume you extracted RAPT to C:\\tools\\RAPT. In the command line write::
cd "C:\tools\RAPT"
.. ifconfig:: not is_renpy
Let's assume you extracted PGS4A to C:\\tools\\PGS4A. In the command line write::
cd "C:\tools\PGS4A"
Now you're within the |PGS4A| directory.
On Windows, if the .py extension is registered to Python 2.7, you then can
just run::
android.py test
Otherwise, you'll have to give the full path to Python 2.7::
If you don't know what the above means or you don't want to do it, you
will have to add the full path to Python to each command in
the following steps of this guide beginning with 'android.py'. If you
installed Python to the default location, the above command would become::
C:\python27\python.exe android.py test
If you installed Python to a different location, then find your Python install
in Explorer, click in the address bar and copy the path, then replace
``C:\python27`` with the path you copied instead - leaving ``\python.exe`` on the
end. So if your Python install is in ``C:\tools\python``, you would type::
C:\tools\python\python.exe android.py test
.. warning::
If the path to Python that you copied has any spaces in - for example, if you had installed it in the
``Program Files`` directory - you will need to put double quotes at the beginning of the whole
command and just after ``python.exe``::
"C:\Program Files\Python\python.exe" android.py test
On Linux, you may need to prefix the command with the current
directory::
./android.py test
For the rest of this documentation, we'll just use ``android.py``, and
leave it up to you to figure out how to convert that to the
appropriate command on your system.
For the rest of this documentation, we'll just use ``android.py`` - if you had to include the path
to Python in the example above, you will need to do the same thing every time you see ``android.py``
in these instructions.
Step 2: Set up the Android SDK and Development Environment
@@ -130,7 +187,7 @@ development environment. This step will:
* Use the Android SDK to install the appropriate development
packages.
* Create a signing key that will be used to sign packages that are
placed on the market.
placed on the market (android.keystore: this will be generated in the |PGS4A| directory).
This step requires Internet access.
@@ -147,6 +204,8 @@ warnings about licenses, and ask if you want it to generate a key.
passphrase. You should really use keytool to generate your own
signing keys.
http://docs.oracle.com/javase/1.3/docs/tooldocs/win32/keytool.html
At the very least, you should keep the android.keyring file in
a safe place. You should also back it up, because without the
key, you won't be able to upload the generated applications.
@@ -234,9 +293,12 @@ warnings about licenses, and ask if you want it to generate a key.
if __name__ == "__main__":
main()
In the examples below, ``mygame`` is short for the path to the game
you're working on, relative to the current directory. When you make
your own game, you should change ``mygame`` to something else.
In the examples below, ``mygame`` is short for the path to the game
you're working on, relative to the current directory. When you make
your own game, you should change ``mygame`` to something else.
The easiest way to do this, of course, is to make a copy of your game's
directory inside the |PGS4A| directory and then replace ``mygame`` in
the examples below with the name of your game's directory.
Step 3: Configure Your Game
---------------------------
@@ -249,9 +311,6 @@ about your game. You can do this with the following command::
This will ask you a series of questions about your game, and store
that information in a file in the game directory.
The only difficult question should be the one about layout. For your
first game, you want to put it on the internal storage.
If you need to change the information - for example, if you release a
new version of your game - you can re-run the configure command. Your
previous choices will be remembered.
@@ -272,6 +331,15 @@ command to make sure it succeeds.
Once the game successfully installs, you can touch its icon in your
device's launcher to start it running.
If you'd rather just copy the game's apk file to your Android device manually, you can just run::
android.py build mygame release
Then navigate to the 'bin' directory inside |PGS4A| and copy the file mygame-release.apk into your Android Device.
You will then need to find the .apk file in your Android device using your file application and open it to install the
game.
The build command passes the options after the game name to the ant
tool, which is responsible for creating the Android package. Other
commands are also possible - for a list, run::
@@ -289,3 +357,93 @@ To view debug output from your application, run the logcat command::
This command runs the ``adb logcat`` command in a mode that selects
only Python output.
Troubleshooting and Support
---------------------------
Here's a list of errors that you might encounter and possible solutions:
When trying to run::
android.py test
After having associated .py files with Python 2.7, if you get::
Traceback (most recent call last):
File "C:\Visual Novels and Games\rapt-6.13.11.0\android.py", line 9, in <module>
import subprocess
File "C:\Python27\lib\subprocess.py", line 444, in <module>
from _subprocess import CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP
ImportError: cannot import name CREATE_NEW_PROCESS_GROUP
This may be related to having more than one version of Python installed on your system.
Try running android.py with the full path to Python, e.g.::
C:\python27\python.exe android.py test
(If this works, then you will need to include the full path to Python in every command,
as if you didn't have the file type associated.)
If while downloading Apache Ant you get::
IOError: [Errno socket error] [Errno 10054] An existing connection was forcibly
closed by the remote host
Just try installing the sdk again with the same command.
If while configuring your game you get something like::
Tag <manifest> attribute package has invalid character '-'.
You may have inserted an invalid character in the package name you used during
configuration (in this case a hyphen '-'). You'll have to use a different
package name which does not contain anything other than letters and dots.
If while configuring you get something like::
Traceback (most recent call last):
File "android.py", line 66, in <module>
main()
File "android.py", line 44, in main
configure.configure(iface, directory)
File "buildlib\configure.py", line 108, in configure
config.save(directory)
File "buildlib\configure.py", line 30, in save
with file(os.path.join(directory, ".android.json"), "w") as f:
IOError: [Errno 2] No such file or directory: 'mygame\\.android.json'
You should check whether you specified the correct path to your game directory. The easiest
way to be sure is to put your game's directory inside the |PGS4A| directory, and simply supply
the name of your game's directory. (If your game's directory name has spaces, you may need
to surround it with double quotes.)
If building your game gives you an error like:
Error: Target id android-8 is not valid. Use 'android list targets' to get the target ids
You might want to check whether you have Android 2.2 (API 8) in the Android SDK manager.
You can run it by navigating to the android-sdk/tools directory inside the |PGS4A| directory
and run android.bat.
.. image:: android_sdk_manager_001.jpg
:align: center
If Android 2.2 (API 8) is missing like in the above image, click 'Updates' and then 'Install Updates'.
Once the updates are installed, make sure Android 2.2 (API 8) and SDK platform are ticked:
.. image:: android_sdk_manager_005.jpg
:align: center
And install the packages. Then, try building your game again.
.. ifconfig:: is_renpy
If you still have questions or doubts you can try searching through or posting on the
|PGS4A| thread over at the Lemmasoft forums:
http://lemmasoft.renai.us/forums/viewtopic.php?f=32&t=13987&hilit=rapt
Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

+1 -1
View File
@@ -270,5 +270,5 @@ rst_prolog = """\
def setup(app):
app.add_config_value('is_renpy', '', True)
is_renpy = False
is_renpy = True
+5 -1
View File
@@ -25,7 +25,7 @@
Adds a pattern marking files as executable on platforms that support it.
(Linux and Macintosh)
.. function:: build.package(name, format, file_lists, description=None, update=True)
.. function:: build.package(name, format, file_lists, description=None, update=True, dlc=False)
Declares a package that can be built by the packaging
tool.
@@ -57,4 +57,8 @@
`update`
If true and updates are being built, an update will be
built for this package.
`dlc`
If true, any zip or tar.bz2 file will be built in
standalone DLC mode, without an update directory.
+1 -1
View File
@@ -28,7 +28,7 @@ init -1 python hide:
# These control the name and version of the game, that are reported
# with tracebacks and other debugging logs.
config.name = "Ren'Py Tutorial"
config.version = "6.14 \"Steampunk Hamster\""
config.version = "6.15 \"...\""
## We then want to call a theme function. themes.roundrect is
## a theme that features the use of rounded rectangles. It's