Android Platform
Plugin Specs
- Compatibility
- Unity versions 2018.x and later are supported
- Android Oreo 8.0 (API 26) and later are supported
- Android 9.0 (API 28) and later recommended
- Supported CPU architectures are arm-v7a, arm64-v8a, x86 and x86-64
- Rendering
- Supported APIs:
- OpenGL ES 3.0
- Vulkan
- Multi-threaded rendering is supported
- Supported APIs:
- Internals
- Under the hood we’re using Android's MediaCodec API
- The only 3rd-party libraries used are:
- stb_image (Trial version only)
- stb_image_write (Used for png and jpg writing on APIs 28 and 29, later APIs use Android's built in image APIs)
- rapidxml
- Oboe
Supported Codecs
See the Codecs section for more information.
Troubleshooting
Collecting logcat output
We often need to see the device logs to work out why something isn't working. For this the device should be connected via USB.
If you're using Android Studio then you can click on the Logcat
tab and choose No Filters
in the bar on the top right. You should see logs being produced and can copy-paste all of them into a text file.
Another useful tool on Windows is called mLogcat and is a GUI tool for monitoring and capturing logs from Android.
Alternatively the command-line tool adb can be used from the Android SDK. Just run the following from a console (Windows) or terminal (macOS) window:
adb logcat
Portrait captures are landscape with 90° rotation
Some Android devices have hardware encoders that are less flexible and provide better support for a landscape orientation.
For instance, the Xiaomi Redmi Note 10 is able to capture HEVC at a maximum resolution of 3840x2160. When making a screen capture in landscape this is fine and is able to fully capture the screen resolution of 2400x1080. However in portrait the vertical resolution of 2400 pixels is greater than the maximum supported vertical resolution of the encoder at 2160 pixels. Therefore, in order to provide screen captures at full resolution we capture in landscape and add a 90° rotation to the videos metadata.
You can disable this behaviour by enabling "No Capture Rotation" in the Android platform specific options of the Capture component inspector.
Capture 'Relative to Videos'
By default the media gallery will be invoked. You can disable this behaviour by disabling "Update Media Gallery" in the Android platform specific options of the Capture component inspector.
Fails to create recorder when using the microphone as the audio source
This is most likely due to permission not being granted for using the microphone.
Because we do not use Unity's Microphone class, Unity is not aware that it needs to add the recording permission to the manifest. Details of how to do this are available here. You need to add the following line before the application
section of the manifest:
<uses-permission android:name="android.permission.RECORD_AUDIO" android:required="false" />
You will also need to request permission at run time. See the Requst Audio Permission section for more details.