Browse Source

Fix typos and formatting issues for the updated Android documentation

Fredia Huya-Kouadio 1 year ago
parent
commit
80d80c3432

+ 13 - 17
tutorials/platform/android/android_library.rst

@@ -20,7 +20,7 @@ Using the Godot Android library
 
 
 The Godot Android library is packaged as an AAR archive file and hosted on `MavenCentral <https://central.sonatype.com/artifact/org.godotengine/godot>`_ along with `its documentation <https://javadoc.io/doc/org.godotengine/godot/latest/index.html>`_.
 The Godot Android library is packaged as an AAR archive file and hosted on `MavenCentral <https://central.sonatype.com/artifact/org.godotengine/godot>`_ along with `its documentation <https://javadoc.io/doc/org.godotengine/godot/latest/index.html>`_.
 
 
-It is used to provide access to Godot APIs and capabilities on Android platforms for the following (non-exhaustive) use-cases.
+It provides access to Godot APIs and capabilities on Android platforms for the following non-exhaustive use-cases.
 
 
 Godot Android plugins
 Godot Android plugins
 ---------------------
 ---------------------
@@ -28,31 +28,27 @@ Godot Android plugins
 Android plugins are powerful tools to extend the capabilities of the Godot Engine
 Android plugins are powerful tools to extend the capabilities of the Godot Engine
 by tapping into the functionality provided by Android platforms and ecosystem.
 by tapping into the functionality provided by Android platforms and ecosystem.
 
 
-They are also Android libraries with a dependency on the Godot Android library
-which is used for access to the Godot APIs and integration into the engine's lifecycle.
-
-They offer similar features to the Godot Android library,
-notably the ability to integrate with the Gradle (or other Android supported) build system,
-and the ability to be portable and embeddable.
-
-Access to Godot APIs and lifecycle grants Android plugins powerful capabilities
-such as GDExtension which allows to update / mod the engine behavior as needed.
+An Android plugin is an Android library with a dependency on the Godot Android library
+which the plugin uses to integrate into the engine's lifecycle and to access Godot APIs,
+granting it powerful capabilities such as GDExtension support which allows to update / mod the engine behavior as needed.
 
 
 For more information, see :ref:`Godot Android plugins <doc_android_plugin>`.
 For more information, see :ref:`Godot Android plugins <doc_android_plugin>`.
 
 
 Embedding Godot in existing Android projects
 Embedding Godot in existing Android projects
 --------------------------------------------
 --------------------------------------------
 
 
-The Godot Engine can be integrated within existing Android applications or libraries,
+The Godot Engine can be embedded within existing Android applications or libraries,
 allowing developers to leverage mature and battle-tested code and libraries better suited to a specific task.
 allowing developers to leverage mature and battle-tested code and libraries better suited to a specific task.
 
 
 The hosting component is responsible for driving the engine lifecycle via Godot's Android APIs.
 The hosting component is responsible for driving the engine lifecycle via Godot's Android APIs.
-These APIs can also be used to provide bidirectional communication between the host and the running Godot instance allowing for greater control over the desired experience.
+These APIs can also be used to provide bidirectional communication between the host and the embedded
+Godot instance allowing for greater control over the desired experience.
 
 
-We showcase how this is done using a sample Android app that uses the Godot Engine as an embeddable Android view to render 3D GLTF models.
+We showcase how this is done using a sample Android app that embeds the Godot Engine as an Android view,
+and uses it to render 3D GLTF models.
 
 
 The `GLTF Viewer <https://github.com/m4gr3d/Godot-Android-Samples/tree/master/apps/gltf_viewer>`_ sample app uses an `Android RecyclerView component <https://developer.android.com/develop/ui/views/layout/recyclerview>`_ to create
 The `GLTF Viewer <https://github.com/m4gr3d/Godot-Android-Samples/tree/master/apps/gltf_viewer>`_ sample app uses an `Android RecyclerView component <https://developer.android.com/develop/ui/views/layout/recyclerview>`_ to create
-and populate a list of GLTF items from `Kenney's Food Kit pack <https://kenney.nl/assets/food-kit>`_.
+a list of GLTF items, populated from `Kenney's Food Kit pack <https://kenney.nl/assets/food-kit>`_.
 When an item on the list is selected, the app's logic interacts with the embedded Godot Engine to render the selected GLTF item as a 3D model.
 When an item on the list is selected, the app's logic interacts with the embedded Godot Engine to render the selected GLTF item as a 3D model.
 
 
 .. image:: img/gltf_viewer_sample_app_screenshot.webp
 .. image:: img/gltf_viewer_sample_app_screenshot.webp
@@ -174,18 +170,18 @@ Below we break-down the steps used to create the GLTF Viewer app.
 
 
   On Android, Godot's project files are exported to the ``assets`` directory of the generated ``apk`` binary.
   On Android, Godot's project files are exported to the ``assets`` directory of the generated ``apk`` binary.
 
 
-  We use that info to bind our Android app and Godot project together by creating the Godot project in the Android app's ``assets`` directory.
+  We leverage that architecture to bind our Android app and Godot project together by creating the Godot project in the Android app's ``assets`` directory.
 
 
   Note that it's also possible to create the Godot project in a separate directory and export it as a `PCK or ZIP file <https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html#pck-versus-zip-pack-file-formats>`_
   Note that it's also possible to create the Godot project in a separate directory and export it as a `PCK or ZIP file <https://docs.godotengine.org/en/stable/tutorials/export/exporting_projects.html#pck-versus-zip-pack-file-formats>`_
   to the Android app's ``assets`` directory.
   to the Android app's ``assets`` directory.
   Using this approach requires passing the ``--main-pack <pck_or_zip_filepath_relative_to_assets_dir>`` argument to the hosted Godot Engine instance using `GodotHost#getCommandLine() <https://github.com/godotengine/godot/blob/6916349697a4339216469e9bf5899b983d78db07/platform/android/java/lib/src/org/godotengine/godot/GodotHost.java#L45>`_.
   Using this approach requires passing the ``--main-pack <pck_or_zip_filepath_relative_to_assets_dir>`` argument to the hosted Godot Engine instance using `GodotHost#getCommandLine() <https://github.com/godotengine/godot/blob/6916349697a4339216469e9bf5899b983d78db07/platform/android/java/lib/src/org/godotengine/godot/GodotHost.java#L45>`_.
 
 
-  The instructions below (and the sample app) follow the first approach of creating the Godot project in the Android app's ``assets`` directory.
+  The instructions below and the sample app follow the first approach of creating the Godot project in the Android app's ``assets`` directory.
 
 
 
 
 - As mentioned in the **note** above, open the Godot Editor and create a Godot project directly (no subfolder) in the ``assets`` directory of the Android application project
 - As mentioned in the **note** above, open the Godot Editor and create a Godot project directly (no subfolder) in the ``assets`` directory of the Android application project
 
 
-  - See the sampple app's `Godot project <https://github.com/m4gr3d/Godot-Android-Samples/tree/master/apps/gltf_viewer/src/main/assets>`_ for reference
+  - See the sample app's `Godot project <https://github.com/m4gr3d/Godot-Android-Samples/tree/master/apps/gltf_viewer/src/main/assets>`_ for reference
 
 
 - Configure the Godot project as desired
 - Configure the Godot project as desired
 
 

+ 17 - 16
tutorials/platform/android/android_plugin.rst

@@ -29,7 +29,7 @@ v2 Architecture
     Godot Android plugin leverages the :ref:`Gradle build system <doc_android_gradle_build>`.
     Godot Android plugin leverages the :ref:`Gradle build system <doc_android_gradle_build>`.
 
 
 
 
-Building on the previous architecture, Android plugins continue to be derived from the
+Building on the previous v1 architecture, Android plugins continue to be derived from the
 `Android archive library <https://developer.android.com/studio/projects/android-library#aar-contents>`_.
 `Android archive library <https://developer.android.com/studio/projects/android-library#aar-contents>`_.
 
 
 At its core, a Godot Android plugin v2 is an Android library with a dependency on the :ref:`Godot Android library <doc_android_library>`,
 At its core, a Godot Android plugin v2 is an Android library with a dependency on the :ref:`Godot Android library <doc_android_library>`,
@@ -43,7 +43,7 @@ This architecture allows Android plugins to extend the functionality of the engi
 - Native libraries (via JNI)
 - Native libraries (via JNI)
 - GDExtension libraries
 - GDExtension libraries
 
 
-Each plugin has an init class extending from the `GodotPlugin class <https://github.com/godotengine/godot/blob/0a7f75ec7b465604b6496c8f5f1d638aed250d6d/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java#L80>`_
+Each plugin has an init class extending from the `GodotPlugin <https://github.com/godotengine/godot/blob/0a7f75ec7b465604b6496c8f5f1d638aed250d6d/platform/android/java/lib/src/org/godotengine/godot/plugin/GodotPlugin.java#L80>`_ class
 which is provided by the :ref:`Godot Android library <doc_android_library>`.
 which is provided by the :ref:`Godot Android library <doc_android_library>`.
 
 
 The ``GodotPlugin`` class provides APIs to access the running Godot instance and hook into its lifecycle. It is loaded at runtime by the Godot engine.
 The ``GodotPlugin`` class provides APIs to access the running Godot instance and hook into its lifecycle. It is loaded at runtime by the Godot engine.
@@ -72,7 +72,7 @@ To provide further understanding, here is a break-down of the steps used to crea
 
 
 1. Create an Android library module using `these instructions <https://developer.android.com/studio/projects/android-library>`_
 1. Create an Android library module using `these instructions <https://developer.android.com/studio/projects/android-library>`_
 
 
-2. Add the Godot Android library as a dependency by updating the module's ``gradle`` `build file <https://github.com/m4gr3d/Godot-Android-Plugin-Template/blob/main/plugin/build.gradle.kts#L42>`_.::
+2. Add the Godot Android library as a dependency by updating the module's ``gradle`` `build file <https://github.com/m4gr3d/Godot-Android-Plugin-Template/blob/main/plugin/build.gradle.kts#L42>`_::
 
 
       dependencies {
       dependencies {
           implementation("org.godotengine:godot:4.2.0.stable")
           implementation("org.godotengine:godot:4.2.0.stable")
@@ -100,7 +100,7 @@ To provide further understanding, here is a break-down of the steps used to crea
   Where:
   Where:
 
 
       - ``PluginName`` is the name of the plugin
       - ``PluginName`` is the name of the plugin
-      - ``plugin.init.ClassFullName`` is the full name (package + class name) of the plugin loading class (e.g: ``org.godotengine.plugin.android.template.GodotAndroidPlugin``).
+      - ``plugin.init.ClassFullName`` is the full component name (package + class name) of the plugin init class (e.g: ``org.godotengine.plugin.android.template.GodotAndroidPlugin``).
 
 
 5. Create the `EditorExportPlugin configuration <https://github.com/m4gr3d/Godot-Android-Plugin-Template/tree/main/plugin/export_scripts_template>`_ to package the plugin. The steps used to create the configuration can be seen in the `Packaging a v2 Android plugin`_ section.
 5. Create the `EditorExportPlugin configuration <https://github.com/m4gr3d/Godot-Android-Plugin-Template/tree/main/plugin/export_scripts_template>`_ to package the plugin. The steps used to create the configuration can be seen in the `Packaging a v2 Android plugin`_ section.
 
 
@@ -143,13 +143,13 @@ Use the following steps if you have a v1 Android plugin you want to migrate to v
 Packaging a v2 Android plugin
 Packaging a v2 Android plugin
 -----------------------------
 -----------------------------
 
 
-As mentioned, a v2 Android plugin is now provided to the Godot Editor as an ``EditorExportPlugin plugin``, so it shares a lot of the `same packaging steps <https://docs.godotengine.org/en/stable/tutorials/plugins/editor/making_plugins.html#creating-a-plugin>`_.
+As mentioned, a v2 Android plugin is now provided to the Godot Editor as an ``EditorExportPlugin`` plugin, so it shares a lot of the `same packaging steps <https://docs.godotengine.org/en/stable/tutorials/plugins/editor/making_plugins.html#creating-a-plugin>`_.
 
 
 1. Add the plugin output binaries within the plugin directory (e.g: in ``addons/<plugin_name>/``)
 1. Add the plugin output binaries within the plugin directory (e.g: in ``addons/<plugin_name>/``)
 
 
 2. Add the `tool script <https://docs.godotengine.org/en/stable/tutorials/plugins/editor/making_plugins.html#the-script-file>`_ for the export functionality within the plugin directory (e.g: in ``addons/<plugin_name>/``)
 2. Add the `tool script <https://docs.godotengine.org/en/stable/tutorials/plugins/editor/making_plugins.html#the-script-file>`_ for the export functionality within the plugin directory (e.g: in ``addons/<plugin_name>/``)
 
 
-    - The created script must be ``@tool`` script, or else it will not work properly
+    - The created script must be a ``@tool`` script, or else it will not work properly
     - The export tool script is used to configure the Android plugin and hook it within the Godot Editor's export process. It should look something like this::
     - The export tool script is used to configure the Android plugin and hook it within the Godot Editor's export process. It should look something like this::
 
 
         @tool
         @tool
@@ -191,18 +191,19 @@ As mentioned, a v2 Android plugin is now provided to the Godot Editor as an ``Ed
             func _get_name():
             func _get_name():
                 return _plugin_name
                 return _plugin_name
 
 
-        - Here are the set of `EditorExportPlugin APIs <https://docs.godotengine.org/en/stable/classes/class_editorexportplugin.html>`_ most relevant to use in this tool script:
 
 
-            - `_supports_platform <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-supports-platform>`_: returns ``true`` if the plugin supports the given platform. For Android plugins, this must return ``true`` when ``platform`` is `EditorExportPlatformAndroid <https://docs.godotengine.org/en/stable/classes/class_editorexportplatformandroid.html>`_
-            - `_get_android_libraries <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-libraries>`_: retrieve the local paths of the Android libraries binaries (AAR files) provided by the plugin
-            - `_get_android_dependencies <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-dependencies>`_: retrieve the set of Android maven dependencies (e.g: `org.godot.example:my-plugin:0.0.0`) provided by the plugin
-            - `_get_android_dependencies_maven_repos <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-dependencies-maven-repos>`_: retrieve the urls of the maven repos for the android dependencies provided by ``_get_android_dependencies``
-            - `_get_android_manifest_activity_element_contents <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-manifest-activity-element-contents>`_: update the contents of the `<activity>` element in the generated Android manifest
-            - `_get_android_manifest_application_element_contents <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-manifest-application-element-contents>`_: update the contents of the `<application>` element in the generated Android manifest
-            - `_get_android_manifest_element_contents <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-manifest-element-contents>`_: update the contents of the `<manifest>` element in the generated Android manifest
+    - Here are the set of `EditorExportPlugin APIs <https://docs.godotengine.org/en/stable/classes/class_editorexportplugin.html>`_ most relevant to use in this tool script:
 
 
-          The ``_get_android_manifest_*`` methods allow the plugin to automatically provide changes
-          to the app's manifest which are preserved when the Godot Editor is updated, resolving a long standing issue with v1 Android plugins.
+        - `_supports_platform <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-supports-platform>`_: returns ``true`` if the plugin supports the given platform. For Android plugins, this must return ``true`` when ``platform`` is `EditorExportPlatformAndroid <https://docs.godotengine.org/en/stable/classes/class_editorexportplatformandroid.html>`_
+        - `_get_android_libraries <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-libraries>`_: retrieve the local paths of the Android libraries binaries (AAR files) provided by the plugin
+        - `_get_android_dependencies <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-dependencies>`_: retrieve the set of Android maven dependencies (e.g: `org.godot.example:my-plugin:0.0.0`) provided by the plugin
+        - `_get_android_dependencies_maven_repos <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-dependencies-maven-repos>`_: retrieve the urls of the maven repos for the android dependencies provided by ``_get_android_dependencies``
+        - `_get_android_manifest_activity_element_contents <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-manifest-activity-element-contents>`_: update the contents of the `<activity>` element in the generated Android manifest
+        - `_get_android_manifest_application_element_contents <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-manifest-application-element-contents>`_: update the contents of the `<application>` element in the generated Android manifest
+        - `_get_android_manifest_element_contents <https://docs.godotengine.org/en/latest/classes/class_editorexportplugin.html#class-editorexportplugin-method-get-android-manifest-element-contents>`_: update the contents of the `<manifest>` element in the generated Android manifest
+
+        The ``_get_android_manifest_*`` methods allow the plugin to automatically provide changes
+        to the app's manifest which are preserved when the Godot Editor is updated, resolving a long standing issue with v1 Android plugins.
 
 
 
 
 3. Create a ``plugin.cfg``. This is an INI file with metadata about your plugin::
 3. Create a ``plugin.cfg``. This is an INI file with metadata about your plugin::