Package com. devbase. utils. util

Defines global function for frequently used case

Types

Link copied to clipboard
annotation class Installer
Link copied to clipboard
annotation class SecurityCheck

Functions

Link copied to clipboard
fun checkForDebugger(action: (Boolean) -> Unit)

method to check does the device running the app is connected to a debugger

Link copied to clipboard
suspend fun compressImage(toCompress: File, format: Bitmap.CompressFormat? = null): File

method to compress image from File

Link copied to clipboard
fun Context?.displayDialog(    title: String,     message: String,     positiveAction: Pair<String, () -> Unit?>,     negativeAction: Pair<String, () -> Unit?>? = null,     autoDismiss: Boolean = false)

Method to display MaterialDialog

Link copied to clipboard
fun Context?.displayNotification(    channelId: String,     title: String,     message: String,     @DrawableRes notifIcon: Int,     notificationId: Int = 0,     pendingIntent: PendingIntent? = null)

Method to displaying notification

Link copied to clipboard
fun View.displaySnackBar(    message: String,     isItLong: Boolean = false,     action: Pair<String, View.OnClickListener>? = null)

Method to display Snackbar

Link copied to clipboard
fun Context?.displayToast(message: String, isItLong: Boolean = false)

Method to display Toast

Link copied to clipboard
fun getBitmapFromDrawable(drawable: Drawable): Bitmap

Method to convert drawable to bitmap

Link copied to clipboard
fun getColorResource(@ColorRes id: Int): Int

Method to get Color from resource

Link copied to clipboard
fun Context.getDeviceId(): String

Method to get device Id

Link copied to clipboard
fun getDrawableResource(@DrawableRes id: Int): Drawable?

Method to get drawable from resource

Link copied to clipboard
fun getMimeType(path: String): String?

get the file extension from path

Link copied to clipboard
fun getStringArrayResource(id: Int): Array<String>

Method to get array string from resource

Link copied to clipboard
fun getStringResource(@StringRes id: Int): String

Method to get String from resource

Link copied to clipboard
fun View.hideSoftKeyboard()

Method to hide keyboard from selected view

Link copied to clipboard
fun imageToBase64(path: String): String

method to convert file to base64

Link copied to clipboard
fun isNetworkConnected(): Boolean

Method to check internet connection

Link copied to clipboard
fun isThisAppRunning(packageName: String): Boolean

Method to check if current app is running or not

Link copied to clipboard
fun isThisServiceRunning(serviceClass: Class<*>): Boolean

Method to check if defined service is running or not

Link copied to clipboard
inline fun logDebug(t: Throwable?)
inline fun logDebug(t: Throwable? = null, message: () -> String)

Method to log debug with throwable

Link copied to clipboard
inline fun logError(t: Throwable?)
inline fun logError(t: Throwable? = null, message: () -> String)

Method to log error with throwable

Link copied to clipboard
inline fun logInfo(t: Throwable?)
inline fun logInfo(t: Throwable? = null, message: () -> String)

Method to log info with throwable

Link copied to clipboard
inline fun logVerbose(t: Throwable?)
inline fun logVerbose(t: Throwable? = null, message: () -> String)

Method to log verbose with throwable

Link copied to clipboard
inline fun logWarn(t: Throwable?)
inline fun logWarn(t: Throwable? = null, message: () -> String)

Method to log warn with throwable

Link copied to clipboard
inline fun logWtf(t: Throwable?)
inline fun logWtf(t: Throwable? = null, message: () -> String)

Method to log wtf with throwable

Link copied to clipboard
fun Context.securityCheck(): Int

Method to check device integrity

Link copied to clipboard
fun View.showKeyboard()

Method to show keyboard from selected view

Link copied to clipboard
fun Context.verifyInstaller(): Boolean

method to check the application that installs our application

Properties

Link copied to clipboard
const val AMAZON_APP_STORE: String
Link copied to clipboard
const val EMULATOR: Int = 0
Link copied to clipboard
const val GOOGLE_PLAY_STORE: String
Link copied to clipboard
const val HUAWEI_APP_GALLERY: String
Link copied to clipboard
const val ROOTED: Int = 2
Link copied to clipboard
const val SAFE: Int = 1