Multi-language entry cross-application sharing method and system based on Android system

By using a system-level AAR to host common terminology resources, the problems of inconsistent translations and redundant APK size in Android application development have been solved. This has enabled cross-application multilingual translation consistency and efficient maintenance, improving user experience and device performance.

CN121597327APending Publication Date: 2026-03-03SICHUAN CHANGHONG ELECTRIC CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511744066.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-25
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In Android application development, the independent maintenance of terminology resources by multiple modules leads to inconsistent translations, a large maintenance workload, and redundant APK size, which affects user experience and device storage efficiency.

Method used

The system uses a shared AAR (Android Archive) to host common entries. By building multilingual values ​​folders and deploying them to the non-erasable partition of the Android system, configuring global read permissions, and adapting during application compilation and automatically matching language settings at runtime, entry sharing across applications is achieved.

Benefits of technology

It achieves consistency in term translation across different applications, reduces maintenance workload, optimizes APK size, and improves user experience and device storage efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121597327A_ABST
    Figure CN121597327A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-language vocabulary entry cross-application sharing method based on an Android system, which comprises the following steps of: constructing a system-level multi-language sharing carrier AAR: creating multi-language value folders taking English vocabulary entries as uniform resource names, and storing standard translations of corresponding languages in each folder; deploying a system-level AAR: storing the AAR in a non-erasable partition of the Android system; application compilation period adaptation: each application configures the AAR to be dependent during compilation, and the application quotes multilingual resources in the AAR; calling a runtime entry: setting a value folder matched with a corresponding language in the AAR according to a current device language, and reading a corresponding target translation by an application; the invention further discloses a multi-language entry cross-application sharing system based on the Android system. According to the multi-language entry cross-application sharing method and system based on the Android system, the problems that Android multi-application entry translation is inconsistent, the maintenance workload is large, and the APK size is redundant are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Android application development and multi-module resource management, and in particular to a method and system for cross-application sharing of multilingual entries based on the Android system. Background Art

[0002] In the field of Android application development and multilingual adaptation, the multilingual translation management of common English entries directly affects the cross-application user experience and the efficiency of global product implementation, and is a core technical link in the scenario of smart devices going global. Traditional technical methods usually independently maintain entry resources by each application and multiple modules within the application. Developers create resource files such as strings.xml in the modules they are responsible for, and define the Chinese and other language translations of common English entries such as "Picture" and "Submit" by themselves, and then package the entry resources into the corresponding APK through compilation.

[0003] In the context of the global popularity of smart devices and the expansion of enterprise-level cross-application clusters (such as cross-border e-commerce and overseas office APP matrices), this mode exposes significant defects: the translations of the same English entry often vary in different applications (for example, "Picture" is translated as "图片" in Application A and "图像" in Application B, and "Submit" is translated as "提交" in Application C and "递交" in Application D), resulting in fragmented interaction terms when users switch applications, especially affecting the overseas users' perception of product consistency; when it is necessary to update the translation version of an English entry (such as uniformly adjusting the Chinese of "Picture" to "图片") or add adaptation for a minority language (such as adding Spanish translation), the person in charge of multiple modules needs to modify the resource files one by one, and the repetitive operations make the maintenance workload increase exponentially with the number of applications; at the same time, the repeated common English entries and multilingual translation resources are separately packaged into each APK, resulting in a 5%-15% redundancy in the volume of a single installation package, and the installation and loading experience significantly deteriorates on low-end overseas devices with limited storage capacity. Summary of the Invention

[0004] The purpose of the present invention is to provide a method and system for cross-application sharing of multilingual entries based on the Android system. The present invention adopts a method of using a system-level shared AAR (Android Archive) to carry common entries, and solves the problems of inconsistent translation of Android multi-application entries, large maintenance workload, and redundancy in the volume of APKs.

[0005] To achieve the above purpose, the technical solution adopted by the present invention is: a method for cross-application sharing of multilingual entries based on the Android system, including:

[0006] Construct a system-level multilingual shared container AAR: Create a multilingual values ​​folder with English terms as the unified resource name within the shared container AAR, and store the standard translations of the corresponding languages ​​in each folder;

[0007] Deploy system-level shared carrier AAR: Store the shared carrier AAR in a non-erasable partition of the Android system and configure global readable permissions;

[0008] Application compile-time adaptation: Each application configures the shared carrier AAR as a compile-time dependency. The application references the multilingual resources in the shared carrier AAR in a standard way and automatically resolves the resource IDs in the shared carrier AAR.

[0009] Runtime term invocation: After the Android system starts, it automatically matches the values ​​folder of the corresponding language in the shared carrier AAR according to the current device language settings. The application directly reads the corresponding standard translation through the resource ID parsed at compile time, which is the target translation.

[0010] As a further improvement of the present invention, the standard translation is stored in an XML file in the multilingual values ​​folder used for storing string resources.

[0011] As a further improvement to the present invention, it also includes:

[0012] Multilingual update and maintenance of entries: Modify the XML file for storing string resources in the corresponding language in the shared carrier AAR, push the shared carrier AAR to the non-erasable partition to overwrite the original file, and after restarting, the updated multilingual translation can be loaded.

[0013] As a further improvement of the present invention, the multilingual values ​​folder is named according to the rule of values-language code.

[0014] As a further improvement of the present invention, the shared carrier AAR is not packaged into the APK during application compile-time adaptation.

[0015] This invention also provides a multilingual glossary cross-application sharing system based on the Android system, comprising:

[0016] Shared Carrier AAR Building Module: Used to create a system-level shared carrier AAR containing a multilingual values ​​folder. The multilingual values ​​folder uses English terms as the unified resource name and is used to store the standard translations of the corresponding languages.

[0017] Shared Carrier AAR Deployment Module: Used to store the multilingual shared carrier AAR to the non-erasable partition of the Android system and configure global readable permissions;

[0018] Compilation and adaptation module: used to configure the shared carrier AAR as a compile-time dependency and allow applications to reference multilingual resources in the shared carrier AAR in a standard way;

[0019] Run call module: After the Android system starts, it matches the corresponding language resources in the shared carrier AAR according to the current language setting of the device, and allows the application to read the target translation through the resource ID.

[0020] As a further improvement of the present invention, in the shared carrier AAR construction module, the standard translation is stored in an XML file used to store string resources in the multilingual values ​​folder.

[0021] As a further improvement to the present invention, it also includes:

[0022] Update and maintenance module: Used to modify the XML file for storing string resources in the corresponding language in the shared carrier AAR, and redeploy to update entries without requiring application recompilation.

[0023] The beneficial effects of this invention are:

[0024] This invention constructs a system-level Android Archive (AAR) as a central hub for sharing multilingual glossaries, centrally storing multilingual glossaries shared by various applications. During the compilation phase, each application only adapts this AAR as a compile-only dependency, without packaging it into the APK. At runtime, the application calls the glossary resources in this AAR, realizing a cross-application sharing mechanism for the same glossaries across multiple applications. This ensures the consistency of translation for the same glossaries across different applications and improves the user experience. Attached Figure Description

[0025] Figure 1 This is a flowchart of an embodiment of the present invention. Detailed Implementation

[0026] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0027] Example 1

[0028] like Figure 1As shown, this invention presents a method for sharing multilingual glossaries across applications based on the Android system. This implementation achieves unified management and retrieval of common glossaries across multiple applications by constructing a system-level sharing platform. Using English glossaries as a benchmark, it achieves multilingual translation sharing and standard resource referencing of Android cross-application common English glossaries through a complete process design of "system-level multilingual AAR (Android Archive) construction-deployment-adaptation-retrieval-update". Specifically, it includes the following technical steps:

[0029] 1. System-level shared multilingual AAR (Android Archive) construction: A shared AAR (Android Archive) is built based on English terms. Following Android standard resource specifications, multilingual values ​​folders are set up within the AAR (Android Archive). These multilingual values ​​folders are named according to the "values-language code" rule, such as values-zh (Chinese), values-ja (Japanese), values-ru (Russian), values-es (Spanish), etc. The common-strings.xml file in each folder stores the standard translation for the corresponding language, using the English term as the uniform resource name (key). For example, values-zh defines... <string name="picture"> picture< / string> Defined in values-ru <string name="picture"> изображение< / string> .

[0030] 2. System-level deployment of AAR (Android Archive): The completed shared AAR (Android Archive) is stored in a non-erasable partition of the Android system (such as the / system / lib / aar / directory). During deployment, the values ​​resource folders for all languages ​​are fully preserved, and global read permissions are granted through system permission configuration. Specifically, during deployment, global read permissions at the "u:object_r:system_file:s0" level are granted to the AAR by modifying the system permission configuration file (such as file_contexts). Even if the device is restored to factory settings, the AAR (Android Archive) and multilingual resources will not be deleted, ensuring that cross-application access to all language translation entries is always available.

[0031] 3. Application Compile-Time Adaptation: During the development and compilation phase, each Android application and module adds a compile-time dependency for this common AAR (Android Archive) via build.gradle (compileOnly files('libs / common-multi-lang.aar')). The resource structure of the AAR is fully compatible with native Android resources. Applications can directly reference multilingual resources in the AAR using the standard method @string / [English term name] in their own layout XML, strings.xml, etc., without packaging the AAR into the APK. For example, if the application XML contains android:text="@string / picture", the compilation tool will automatically parse the resource ID in the AAR (Android Archive), ensuring that the reference is valid and does not trigger the packaging of the AAR (Android Archive) entity.

[0032] 4. Runtime Multilingual Terminology Retrieval: When an Android application runs, the system automatically matches the corresponding language's values ​​folder in the system-level AAR (Android Archive) based on the current device's language settings (e.g., Chinese, Japanese, Russian). It then directly reads the target translation from common-strings.xml using the resource ID parsed during application compilation. This entire process relies on Android's native resource retrieval mechanism, requiring no additional system interfaces, and the resource retrieval efficiency is consistent with local resource access.

[0033] 5. Multilingual Glossary Updates and Maintenance: When updating common glossaries, simply modify the common-strings.xml file for the corresponding language in the system-level AAR (Android Archive), and re-push the AAR (Android Archive) to the / system / lib / aar / directory to overwrite the original file. The application does not need to modify the code or recompile. After restarting, the system will automatically load the updated multilingual translations. When the system firmware is updated, the AAR (Android Archive) build is re-executed during the firmware compilation stage to integrate and deploy the latest multilingual glossary resources, ensuring that the resources are synchronized with the firmware version.

[0034] Through the above steps, a unified cross-application multilingual translation based on English terms is achieved. Applications can reference resources using the standard @string method, while avoiding redundant maintenance and APK size, thus improving global development efficiency and multilingual user experience. This embodiment constructs a system-level common AAR (Android Archive) based on English, combined with compile-only compile-time dependencies and Android's native @string referencing mechanism. All applications can obtain multilingual terms from the same AAR (Android Archive), completely resolving translation differences for terms such as "Picture" between different applications and modules, achieving a unified user experience in global scenarios. Updating multilingual translations only requires modifying the corresponding language resource files in the AAR (Android Archive) and redeploying, without modifying any application code, significantly reducing maintenance workload. Simultaneously, avoiding duplicate term resource packaging significantly optimizes the size of individual APKs, freeing up more usable space for low-storage devices, improving the overall user experience, and enhancing product competitiveness.

[0035] Example 2

[0036] A method for sharing multilingual glossaries across applications based on the Android system, specifically including:

[0037] 1. Identify common English terms for Android applications (such as "picture" and "submit"), and clarify the multilingual translation requirements for each term (Chinese, Japanese, Russian, etc.); build an Android Library project as the development platform for AAR (AndroidArchive), create a res folder according to the standard Android resource directory structure, and create multilingual values ​​subfolders under it (such as values-zh "Chinese", values-ja "Japanese", values-ru "Russian"). Create a common-strings.xml resource file in each folder.

[0038] 2. In the common-strings.xml file for each language, write the corresponding translation using the English term as the Uniform Resource Name (key), for example, as defined in values-zh. <string name="picture"> picture< / string> Defined in values-ru <string name="picture"> изображение< / string> .

[0039] 3. Execute the AAR (Android Archive) project compilation command to generate the common-multi-lang.aar file.

[0040] 4. Each Android application should add an AAR (Android Archive) compile-time dependency to its build.gradle file and configure it as compileOnly files('libs / common-multi-lang.aar'). In the application layout xml or strings.xml, reference the multilingual resources in the AAR (Android Archive) using standard methods such as @string / picture. Perform a compilation verification to ensure that there are no "resource not found" errors and that the AAR (Android Archive) has not been packaged into the APK.

[0041] 5. Integrate common-multi-lang.aar into a non-erasable partition in the system, such as the System / lib / aar directory. Modify the system permission configuration file (e.g., file_contexts) to add global read permissions to AAR (Android Archive) (e.g., configure / system / lib / aar / common-multi-lang.aar u:object_r:system_file:s0) to ensure that all applications can access the resource.

[0042] 6. Compile and generate the system firmware, ensuring that common-multi-lang.aar in the System / lib / aar directory is archived along with the firmware image.

[0043] 7. When each application runs, it directly calls the common entries in AAR (Android Archive).

[0044] 8. When an entry needs to be updated, modify the common-strings.xml file for the corresponding language in the AAR (Android Archive) project, recompile and generate a new AAR (Android Archive), and repeat the above process.

[0045] Example 3

[0046] A system for enabling cross-application sharing of multilingual glossaries in Android systems, the system comprising:

[0047] (1) AAR building module: used to create system-level multilingual AARs containing multilingual values ​​folders and common-strings.xml according to Android standard resource specifications, wherein the common-strings.xml uses English terms as the unified resource name;

[0048] (2) AAR Deployment Module: Used to store the multilingual AARs to the non-erasable partition of the Android system and configure global readable permissions;

[0049] (3) Compilation and adaptation module: This module is used to support Android applications in configuring AAR as a compile-time dependency through build.gradle, and allows applications to reference AAR resources through @string / [English term name];

[0050] (4) Run call module: After the system starts, it matches the corresponding language resources in AAR according to the current language setting of the device, and allows the application to read the target translation through the resource ID;

[0051] (5) Update and maintenance module: used to modify common-strings.xml in AAR and redeploy it to update entries without requiring application recompilation.

[0052] The embodiments described above are merely illustrative of specific implementations of the present invention, and while the descriptions are detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. A method for sharing multilingual glossary entries across applications based on the Android system, characterized in that, include: Construct a system-level multilingual shared container AAR: Create a multilingual values ​​folder with English terms as the unified resource name within the shared container AAR, and store the standard translations of the corresponding languages ​​in each folder; Deploy system-level shared carrier AAR: Store the shared carrier AAR in a non-erasable partition of the Android system and configure global readable permissions; Application compile-time adaptation: Each application configures the shared carrier AAR as a compile-time dependency. The application references the multilingual resources in the shared carrier AAR in a standard way and automatically resolves the resource IDs in the shared carrier AAR. Runtime term invocation: After the Android system starts, it automatically matches the values ​​folder of the corresponding language in the shared carrier AAR according to the current device language settings. The application directly reads the corresponding standard translation through the resource ID parsed at compile time, which is the target translation.

2. The method for sharing multilingual glossary entries across applications based on the Android system according to claim 1, characterized in that, The standard translation is stored in an XML file within the multilingual values ​​folder, which is used to store string resources.

3. The method for sharing multilingual glossary entries across applications based on the Android system according to claim 2, characterized in that, Also includes: Multilingual update and maintenance of entries: Modify the XML file for storing string resources in the corresponding language in the shared carrier AAR, push the shared carrier AAR to the non-erasable partition to overwrite the original file, and after restarting, the updated multilingual translation can be loaded.

4. The method for sharing multilingual glossary entries across applications based on the Android system according to claim 1, characterized in that, The multilingual values ​​folder is named according to the value-language code rule.

5. The method for sharing multilingual glossary entries across applications based on the Android system according to claim 1, characterized in that, During application compilation adaptation, the shared carrier AAR is not packaged into the APK.

6. A multilingual glossary sharing system based on the Android system, characterized in that, include: Shared Carrier AAR Building Module: Used to create a system-level shared carrier AAR containing a multilingual values ​​folder. The multilingual values ​​folder uses English terms as the unified resource name and is used to store the standard translations of the corresponding languages. Shared Carrier AAR Deployment Module: Used to store the multilingual shared carrier AAR to the non-erasable partition of the Android system and configure global readable permissions; Compilation and adaptation module: used to configure the shared carrier AAR as a compile-time dependency and allow applications to reference multilingual resources in the shared carrier AAR in a standard way; Run call module: After the Android system starts, it matches the corresponding language resources in the shared carrier AAR according to the current language setting of the device, and allows the application to read the target translation through the resource ID.

7. The multilingual glossary cross-application sharing system based on the Android system according to claim 6, characterized in that, In the shared carrier AAR construction module, the standard translation is stored in an XML file in the multilingual values ​​folder used to store string resources.

8. The multilingual glossary cross-application sharing system based on the Android system according to claim 7, characterized in that, Also includes: Update and maintenance module: Used to modify the XML file for storing string resources in the corresponding language in the shared carrier AAR, and redeploy to update entries without requiring application recompilation.