Ren'Py support devices running the Android operating system, such as smartphones and tablets. You'll need to comply with the terms of that to distribute Ren'Py. We believe including the following language in your app's description will suffice, but check with a lawyer to be sure.
There are many important differences between the touch-based Android platform and the mouse-based platforms that Ren'Py supports. Changes due to the Android software and hardware are:. To help you adapt to these differences, Ren'Py for Android automatically selects screen variants based on the device's screen size and capabilities.
See Screen Variants for more information. Due to the security policy of mobile devices, MultiPersistent functionality is limited only to this game and its updates, i. For testing purposes, Ren'Py supports three Android emulation modes.
These are accessed from the Android screen of the launcher. The keyboard is mapped to remote or controller input, with the arrow keys providing .
Select is enter, Escape is menu, and -up is back. This mode also displays an overlay showing the Television-unsafe area. Content in the Television-unsafe area may not display on all Televisions. While these emulators can be used to quickly test your project, it's best to also test on real hardware.
The emulators do not deal with some human-factors issues, like the size of a user's fingers. Ren'Py contains tools that help you take a packaging-centric approach to Android game development.
How to create a new project in ren'py
In this approach, you will use a PC to build an Android package and it to your device. You can then run the game like any Android application. When it works correctly, you can the package you make to Google Play and other app stores. Once you've finished these steps, you'll have a runnable Android 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.
There are three things you may need to manually download and install before you can build packages:. Java Development Kit. It can be downloaded from:. Android Device.
You'll also want to set your device up for development. You'll want to enable developer mode on your device, and set up your computer for Android development. Instructions on how to set up your computer can be found at:.
Setting the emulator up is outside of the scope of this document. The next step is to set up the Android SDK and the rest of your development environment. This step will:.
Where do i get it?
RAPT will report on what it's doing. It will also prompt you with warnings about s, and ask if you want it to generate a key. The key generated by RAPT is created with a standard passphrase. You should really use keytool to generate your own ing keys. At the very least, you should keep the android. You should also back it up, because without the key, you won't be able to the generated applications. If you don't want to download the SDK each time, you can create a file named sdk. Before building a package, you must give Ren'Py some information about the Android build of your game.
To do this, choose "Configure" from the Android screen of the Ren'Py launcher.
Where does it run?
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 choices will be remembered. Finally, you can build and install the package. The first time you install, your Android device may ask you to authorize your computer to install applications.
If you'd rather copy the game's apk file to your Android device manually, choose "Build Package" from the Android screen of the Ren'Py launcher. Then navigate to the 'bin' directory underneath the RAPT directory and copy the appropriate file to your Android device.
You will then need to find the. Ren'Py allows you to select between two release modes, Debug and Release. The debug mode is useful for testing, as it allows you to easily use Android studio to view the logs or files on the device.
Release produces a version of the app suitable to to the various stores. Android adaptive icons work by masking the two layers of the icon to an area that is at least x pixels, in the center. The area outside of this safe space may be shown, but it might be masked out, too.
Bleeding outside of the safe area is encouraged.
Tool introduction and setup
The two layers might move a little relative to each other when the icon is dragged around. When generating the application, Ren'Py will convert these files to an appropriate size for each device, and will generate static icons for devices that do not support adaptive icons. The presplash is shown before Ren'Py fully lo, before the main splashscreen starts. It's especially important on Android, as the first time Ren'Py runs it will unpack supporting files, which make take some time. Please see:.
For information about expansion APKs work. Ren'Py will transparently use these files. This is the Google Play Licensing key associated with your application, which can be found on the "Monetization Setup" tab associated with your application in the Google Play developer console.
Be sure to remove all spaces and newlines from the key. This should be a tuple of 20 bytes, where each byte is represented as an integer between and This is used to encrypt information returned from Google Play. The expansion APK will be an. In normal operation, Google Play will place the expansion APK on the device automatically when the user installs the application.
Ren'Py Documentation 7. Android link Ren'Py support devices running the Android operating system, such as smartphones and tablets. As part of the suspend process, Ren'Py will automatically save the game. If necessary, the save will be automatically loaded when the user returns to the game.
Menu Brings up the in-game menu, and returns to the game. Back Rolls back.
Platform Differences link There are many important differences between the touch-based Android platform and the mouse-based platforms that Ren'Py supports. Changes due to the Android software and hardware are: The touchscreen is treated as if it was a mouse. However, it will only produce mouse events when the user is actively touching the screen. Movie playback in fullscreen mode can only use media formats that are supported by Android devices.
See this for a list of supported video formats. Text input such as renpy.
Western languages probably work, while other languages might not. In addition, there are a few changes that may be necessary due to human factors: Since Android smartphones can be smaller than a computer monitor, it may be necessary to increase text size.
Since touch input is less accurate than mouse input, touch-based buttons need to be larger than mouse-based ones.
Phone This mode emulates an Android phone. Touch emulation is performed using the mouse, but only when the mouse button is held down. Escape is mapped to the menu button, and Up is mapped to the back button. Tablet This mode emulates an Android tablet.
Building Android Applications link Ren'Py contains tools that help you take a packaging-centric approach to Android game development. Use the launcher to install the Android SDK and create keys. Use the launcher to configure the Android build. Use the launcher to build the Android application. Step 1: Installing the Dependencies link There are three things you may need to manually download and install before you can build packages: Java Development Kit.
This step will: Check that the JDK is installed properly. Install the Android SDK. Use the Android SDK to install the appropriate development packages. Create a ing key that will be used to packages that are placed on the market android. This step requires Internet access. Step 3: Configure Your Game link Before building a package, you must give Ren'Py some information about the Android build of your game.