We’ve noticed that the Unity editor often resets the package name of your project when you save it or when you close the build settings. Make sure to check for this (you will see the wrong package in the editor) and correct it if needed.
Read more…All snippets tagged with android
Page 1 of 7Launch Unity Activity from an Android app
Embed a Unity Activity in an Android app
These instructions were found here originally, and are slightly modified to solve some more errors.
Read more…Check for ARCore before launching a Unity module on Android.
Once you have integrated a Unity module in an Android app, you should add the following to make sure you’re not launching the module on devices that do not support ARCore. It also instructs users to install the ARCore app for devices that support it, but don’t have it yet.
Read more…Support the Back button on Android
Add the following script to your scene to allow the Back button on Android to exit the application:
Read more…Kotlin extension functions for Views
A collection of Kotlin extension methods that simplify many common tasks related to Android Views.
Read more…Kotlin extension functions for Numbers
A collection of Kotlin extension methods that simplify many common tasks related to numbers and maths.
Read more…Kotlin extension functions for Arrays and Lists
A collection of Kotlin extension methods that simplify many common tasks related to Arrays and Lists.
Read more…Common kotlin extensions
Common Kotlin extension functions for several tasks.
Read more…Kotlin extension functions for Bitmaps
A collection of Kotlin extension methods that simplify many common tasks related to Bitmaps.
Read more…Setting up Android SDK on Jenkins
Building Android apps does not work out-of-the-box. Without installing, you will see this error:
Read more…Compress or convert video for embedding in an Android or iOS app
The following uses ffmpeg to compress a video that is optimally compressed for size while keeping an ok quality, and ensures compatibility across 99.99% of the Android and iOS devices.
Read more…Check and observe the availability of the Play Store.
Useful for checking if a watch face is running on a watch that is being used with an iPhone.
Read more…Grant special permissions to a WebView
Accessing the camera or location in a WebView is not possible without granting the WebView
permission. Make sure your app has permissions already through the conventional method before calling this snippet:
Complete example of using a WebView
Fragment with a WebView
and fall-back UI in case there’s no active data connection.
Wrapping a RecyclerView to the height of its content.
This LayoutManager
functions as a wrap_content
of sorts for the height of a RecyclerView
.