Skip to main content

AndroidExtensions

A static class in Root.Township, Alta.Utilities.

Android-only helpers that call Java through AndroidJavaObject. They do nothing useful on the PC server.

Fields​

2 private and internal fields
MemberWhat it is
private static AndroidJavaObject _activityBacking field for Activity.
private const string MediaStoreImagesMediaClassJava class name of MediaStore.Images.Media, used to insert images.

Properties​

1 private and internal property
MemberWhat it is
private static AndroidJavaObject Activity { get; }The current Unity Android activity, fetched from UnityPlayer once and cached.

Methods​

MemberWhat it is
static string SaveImageToGallery(Texture2D texture2D, string title, string description)Saves a texture to the Android photo gallery with a title and description. Returns the new image's URI string.
1 private and internal method
MemberWhat it is
private static AndroidJavaObject Texture2DToAndroidBitmap(Texture2D texture2D)Encodes the texture as PNG and decodes it into an Android Bitmap.