It is recommended to use WebGAL Terre visual editor, which provides an option to export Android project files with one click.
If you build the project using source code, please switch to the source code tab.
- Download and install Android Studio
Open the project in Android Studio
If you want to use Android Studio to open the folder directly exported from the project, please fill in English when creating a new game. If the game folder name is not English, please rename it to English in the more menu or open
WebGAL_Terre\public\games to modify your game name, and ensure that there are no non-English characters in the project file path, otherwise an error will be reported
Game title and
Game package name in the game configuration in the left sidebar of the editor.
The game package name is the reverse of your website domain name. If you don't have a domain name, you can consider using the combination of developer plus game name, such as
webgaldev.mygalgame, must use English.
Select Export to Android project file in the upper right corner of the editor, and the system will automatically open the folder.
Open android studio and select the
android directory that was just exported, and wait for the dependency download to complete.
Download and unzip the project template, and rename the folder (remember to use English).
project folder\app\src\main\assets\webgal folder and put the game you want to package here.
The game loads
project folder\app\src\main\assets\webgal\index.html by default. If you want to customize the loading link (such as an online link), please modify the
load_url field in the
project folder\app\src\main\res\values\values.xml file.
Open Android Studio to open the project.
rootProject.name field in the
project folder\settings.gradle file.
rootProject.name = "WebGAL" //Modify the project title
Modify the title information in
<string name="app_name">WebGAL</string> //Modify the game title
applicationId fields in
project folder\app\build.gradle to the reverse of the domain name.
namespace 'com.openwebgal.demo' //Modify the package name
applicationId "com.openwebgal.demo" //Modify the package name
File -> Sync Project with Gradle files in the menu bar and wait for the synchronization to complete.
package field in the first line of
project folder\app\src\main\java\com\openwebgal\demo\MainActivity.kt to the target package name changed earlier.
package com.openwebgal.demo //Modify the package name
After modifying this field, an error will be reported. At this time, click the package name just modified, and then click the "yellow light bulb" to select
Move file to 'target package name', and then delete the original package name folder.
File -> New -> Image Asset in the menu bar to modify the game icon. Note that the icon is divided into two layers, front and back.
Debug and run
Turn on USB debugging on your Android phone and connect it to your computer. Click the run icon next to the device title in the toolbar above to run it on your phone.
Build -> Generate Signed Bundle or APK in the menu bar, and select
APK in the pop-up menu.
Create or select a key according to the prompts.
release and click
Create to wait for the compilation to complete.
Compatibility and solutions
Currently, the minimum supported version is Android 5.0, and it depends on the pre-installed Android System WebView of the system. If your device goes black after clicking the first screen, please try any of the following solutions:
- Enter the Play Store to update Android System WebView
- Manually download Android System WebView for update