Class AppInfo
Contains all values that can be localized in the Android Application. These values can be displayed when the App is not running, such as the application name that is displayed on the home screen.
Implements
Namespace: UnityEngine .Localization.Platform.Android
Assembly: Unity.Localization.dll
Syntax
[DisplayName("Android App Info", "Packages/com.unity.localization/Editor/Icons/Android/Android.png")]
[Serializable]
public class AppInfo : IMetadata
Examples
This example shows how to configure the Android App Info. Note: You must complete this configuration before the application is built, otherwise, the changes will not be applied.
using UnityEditor;
using UnityEngine.Localization;
using UnityEngine.Localization.Platform.Android;
using UnityEngine.Localization.Settings;
public class AndroidAppInfoExample
{
[MenuItem("Localization/Configure Android App Info")]
public static void ConfigureAppInfo()
{
var appInfo = LocalizationSettings.Metadata.GetMetadata<AppInfo>();
if (appInfo == null)
{
appInfo = new AppInfo();
LocalizationSettings.Metadata.AddMetadata(appInfo);
}
appInfo.DisplayName = new LocalizedString("My Table", "My Display Name");
EditorUtility.SetDirty(LocalizationSettings.Instance);
}
[MenuItem("Localization/Configure Android Icon Info")]
public static void ConfigureIconInfo()
{
var iconInfo = LocalizationSettings.Metadata.GetMetadata<AdaptiveIconsInfo>();
if (iconInfo == null)
{
iconInfo = new AdaptiveIconsInfo();
LocalizationSettings.Metadata.AddMetadata(iconInfo);
}
iconInfo.AdaptiveHdpi = new AdaptiveIcon
{
Background = new LocalizedTexture { TableReference = "My Textures", TableEntryReference = "Hdpi Background" },
Foreground = new LocalizedTexture { TableReference = "My Textures", TableEntryReference = "Hdpi Foreground" }
};
EditorUtility.SetDirty(LocalizationSettings.Instance);
}
}
Properties
Name | Description |
---|---|
Display |
The user-visible name for the bundle, used by Google Assistant and visible on the Android Home screen. |