mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2025-12-31 09:49:22 +03:00
291 lines
11 KiB
Plaintext
291 lines
11 KiB
Plaintext
# SOME DESCRIPTIVE TITLE.
|
|
# Copyright (C) 2014-2019, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0)
|
|
# This file is distributed under the same license as the Godot Engine package.
|
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
|
#
|
|
#, fuzzy
|
|
msgid ""
|
|
msgstr ""
|
|
"Project-Id-Version: Godot Engine latest\n"
|
|
"Report-Msgid-Bugs-To: \n"
|
|
"POT-Creation-Date: 2019-01-09 10:56+0100\n"
|
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
"MIME-Version: 1.0\n"
|
|
"Content-Type: text/plain; charset=UTF-8\n"
|
|
"Content-Transfer-Encoding: 8bit\n"
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:4
|
|
msgid "Creating Android modules"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:7
|
|
msgid "Introduction"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:9
|
|
msgid "Making video games portable is all fine and dandy, until mobile gaming monetization shows up."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:12
|
|
msgid "This area is complex, usually a mobile game that monetizes needs special connections to a server for things like:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:15
|
|
msgid "Analytics"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:16
|
|
msgid "In-app purchases"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:17
|
|
msgid "Receipt validation"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:18
|
|
msgid "Install tracking"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:19
|
|
msgid "Ads"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:20
|
|
msgid "Video ads"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:21
|
|
msgid "Cross-promotion"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:22
|
|
msgid "In-game soft & hard currencies"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:23
|
|
msgid "Promo codes"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:24
|
|
msgid "A/B testing"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:25
|
|
msgid "Login"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:26
|
|
msgid "Cloud saves"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:27
|
|
msgid "Leaderboards and scores"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:28
|
|
msgid "User support & feedback"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:29
|
|
msgid "Posting to Facebook, Twitter, etc."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:30
|
|
msgid "Push notifications"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:32
|
|
msgid "On iOS, you can write a C++ module and take advantage of the C++/ObjC intercommunication."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:35
|
|
msgid "On Android, interfacing with C++ through JNI (Java Native Interface) isn't as convenient."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:38
|
|
msgid "Maybe REST?"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:40
|
|
msgid "Most of these APIs allow communication via REST/JSON APIs. Godot has great support for HTTP, HTTPS and JSON, so consider this as an option that works on every platform. Only write the code once and you are set to go."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:46
|
|
msgid "Android module"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:48
|
|
msgid "Writing an Android module is similar to :ref:`doc_custom_modules_in_c++`, but needs a few more steps."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:51
|
|
msgid "Make sure you are familiar with building your own :ref:`Android export templates <doc_compiling_for_android>`, as well as creating :ref:`doc_custom_modules_in_c++`."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:55
|
|
msgid "config.py"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:57
|
|
msgid "In the config.py for the module, some extra functions are provided for convenience. First, it's often wise to detect if Android is the target platform being built for and only enable building in this case:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:66
|
|
msgid "If more than one platform can be built (typical if implementing the module also for iOS), check manually for Android in the configure functions for Android (or other platform-specific) code:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:80
|
|
msgid "Java singleton"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:82
|
|
msgid "An Android module will usually have a singleton class that will load it, this class inherits from ``Godot.SingletonBase``. Resource identifiers for any additional resources you have provided for the module will be in the ``com.godot.game.R`` class, so you'll likely want to import it."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:87
|
|
msgid "A singleton object template follows:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:153
|
|
msgid "Calling back to Godot from Java is a little more difficult. The instance ID of the script must be known first, this is obtained by calling ``get_instance_ID()`` on the script. This returns an integer that can be passed to Java."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:158
|
|
msgid "From Java, use the ``calldeferred`` function to communicate back with Godot. Java will most likely run in a separate thread, so calls are deferred:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:165
|
|
msgid "Add this singleton to the build of the project by adding the following to config.py:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:181
|
|
msgid "AndroidManifest"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:183
|
|
msgid "Some SDKs need custom values in AndroidManifest.xml. Permissions can be edited from the Godot exporter so there is no need to add those, but maybe other functionalities are needed."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:187
|
|
msgid "Create the custom chunk of android manifest and put it inside the module, add it like this:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:204
|
|
msgid "Resources"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:206
|
|
msgid "In order to provide additional resources with your module you have to add something like this:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:216
|
|
msgid "Now you can refer to those resources by their id (``R.string.my_string``, and the like) by importing the ``com.godot.game.R`` class in your Java code."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:220
|
|
msgid "Assets"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:222
|
|
msgid "Similarly, you can add any type of raw asset files to your app's asset directory like this:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:231
|
|
msgid "Assets don't have resource ids, but can be read with their file name as streams of bytes with the help of the Android AssetManager class."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:235
|
|
msgid "SDK library"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:237
|
|
msgid "So, finally it's time to add the SDK library. The library can come in two flavors, a JAR file or an Android project for ant. JAR is the easiest to integrate, put it in the module directory and add it:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:257
|
|
msgid "SDK project"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:259
|
|
msgid "When this is an Android project, things usually get more complex. Copy the project folder inside the module directory and configure it:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:266
|
|
msgid "As of this writing, Godot uses minsdk 18 and target sdk 27. If this ever changes, it should be reflected in the manifest template: `AndroidManifest.xml.template <https://github.com/godotengine/godot/blob/master/platform/android/AndroidManifest.xml.template>`__"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:270
|
|
msgid "Then, add the module folder to the project:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:286
|
|
msgid "Building"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:288
|
|
msgid "As you probably modify the contents of the module, and modify your .java inside the module, you need the module to be built with the rest of Godot, so compile android normally."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:296
|
|
msgid "This will cause your module to be included, the .jar will be copied to the java folder, the .java will be copied to the sources folder, etc. Each time you modify the .java, scons must be called."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:300
|
|
msgid "Afterwards, continue the steps for compiling android :ref:`doc_compiling_for_android`."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:303
|
|
msgid "Using the module"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:305
|
|
msgid "To use the module from GDScript, first enable the singleton by adding the following line to project.godot:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:314
|
|
msgid "More than one singleton module can be enabled by separating with commas:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:322
|
|
msgid "Then request the singleton Java object from Globals like this:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:335
|
|
msgid "Troubleshooting"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:338
|
|
msgid "Godot crashes upon load"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:340
|
|
msgid "Check ``adb logcat`` for possible problems, then:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:342
|
|
msgid "Make sure libgodot_android.so is in the ``libs/armeabi`` folder"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:343
|
|
msgid "Check that the methods used in the Java singleton only use simple Java datatypes, more complex ones are not supported."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:347
|
|
msgid "Future"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:349
|
|
msgid "Godot has an experimental Java API Wrapper that allows to use the entire Java API from GDScript."
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:352
|
|
msgid "It's simple to use and it's used like this:"
|
|
msgstr ""
|
|
|
|
#: ../../docs/development/cpp/creating_android_modules.rst:358
|
|
msgid "This is most likely not functional yet, if you want to test it and help us make it work, contact us through the `developer mailing list <https://groups.google.com/forum/#!forum/godot-engine>`__."
|
|
msgstr ""
|
|
|