AndroidUtil

open class AndroidUtil : Util

Utility methods for Android.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Global strings holder for theming

Functions

Link copied to clipboard
Link copied to clipboard
open fun callNativeSafe(action: Runnable)
open fun <T> callNativeSafe(action: Supplier<T>): T
Link copied to clipboard
Link copied to clipboard
open fun certificateToPEM(certificate: X509Certificate): String
Link copied to clipboard
Check whether the application has all permissions in a set.
Check whether the application has a permission.
Link copied to clipboard
open fun formatPercentage(value: Double, decimalPlaces: Int): String
open fun formatPercentage(locale: Locale, value: Double, decimalPlaces: Int): String
Link copied to clipboard
open fun gcd(items: Array<Int>): Int
open fun gcd(p: Int, q: Int): Int
Link copied to clipboard
Get display metrics.
Link copied to clipboard
Get the application instance.
Link copied to clipboard
Get the application context.
Link copied to clipboard
Get the application icon.
Link copied to clipboard
Get the application ID.
Link copied to clipboard
Get the application name.
Link copied to clipboard
Get the kernel user-ID that has been assigned to this application.
Link copied to clipboard
Get the application version.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Get a color from the resources.
Link copied to clipboard
Get the currently active context.
Link copied to clipboard
open fun getDimension(context: Context, @DimenRes resId: Int): Int
Get a pixel dimension from the resources.
Link copied to clipboard
Get a drawable from the resources.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getQuantityText(@NonNull name: String, quantity: Int): String
Link copied to clipboard
Link copied to clipboard
Get current DPI as string
Link copied to clipboard
Get resources.
Link copied to clipboard
open fun getScreenHeight(): Int
Get screen height.
Link copied to clipboard
open fun getScreenWidth(): Int
Get screen width.
Link copied to clipboard
open fun <T> getSystemService(@NonNull serviceClass: Class<T>): T
Get system service.
Link copied to clipboard
open fun getText(@NonNull name: String): String
Link copied to clipboard
Get typed array from the resources.
Link copied to clipboard
Get the window manager.
Link copied to clipboard
Check if there is a context.
Link copied to clipboard
Check whether location services are enabled.
Link copied to clipboard
Check if this is main (UI) thread.
Link copied to clipboard
open fun loadClass(@NonNull name: String): Class<out Any>
Exception-safe version of Class.forName.
Link copied to clipboard
open fun rendezvous(@NonNull runnable: Runnable)
Rendezvous with the main (UI) thread.
open fun rendezvous(@Nullable handler: Handler, @NonNull runnable: Runnable)
Rendezvous on a thread.
Link copied to clipboard
open fun repeat(c: Char, n: Int): String
open fun repeat(str: String, n: Int): String
Link copied to clipboard
open fun setContext(@NonNull context: Context)
Set the current context.