Skip to content

Instantly share code, notes, and snippets.

Android ADB `adb shell input keyevent` Codes
public static final int KEYCODE_UNKNOWN = 0;
/** Key code constant: Soft Left key.
* Usually situated below the display on phones and used as a multi-function
* feature key for selecting a software defined function shown on the bottom left
* of the display. */
public static final int KEYCODE_SOFT_LEFT = 1;
/** Key code constant: Soft Right key.
big O cheatsheet
@laithnurie
laithnurie / squaa_policy.md
Last active May 11, 2020 12:03
Squaa Privacy Policy

Privacy Policy

Laith Nurie built the Squaa app as an Ad Supported app. This SERVICE is provided by Laith Nurie at no cost and is intended for use as is.

This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.

If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Squaa unless otherwise defined in this Privacy Policy.

@laithnurie
laithnurie / emulator-install-using-avdmanager.md
Created August 11, 2022 16:42 — forked from mrk-han/emulator-install-using-avdmanager.md
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For generic skin emulator with default apis (without google apis):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-29;default;x86"

@laithnurie
laithnurie / detekt.yml
Created August 17, 2022 14:02
Detekt rules
build:
maxIssues: 0
excludeCorrectable: false
weights:
# complexity: 2
# LongParameterList: 1
# style: 1
# comments: 1
config:
#!/bin/sh
filesToFormat="$(
git --no-pager diff --cached --diff-filter=d --name-only
)"
echo '[git hook] executing gradle detekt and lint before push'
SHOULD_RESET=0
if [[ -n $(git status -s) ]]; then
@laithnurie
laithnurie / detekt.gradle
Created August 18, 2022 15:07
Detekt gradle methods
tasks.register('detektFix', io.gitlab.arturbosch.detekt.Detekt) {
description = "Runs over whole code base without the starting overhead for each module."
autoCorrect = true
parallel = true
setSource(files(projectDir))
include("**/*.kt")
include("**/*.kts")
exclude("**/resources/**")
exclude("**/build/**")
exclude("**/test/**/*.kt")
@laithnurie
laithnurie / dependency-upgrade
Created September 16, 2022 15:59
Version catalog android
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+$/
return !stableKeyword && !(version ==~ regex)
}
dependencyUpdates {
resolutionStrategy {
componentSelection {
all {
apply plugin: 'maven-publish'
// SDK version is passed in as a parameter when you run the script assemble_and_deploy_lib.sh or you can uncomment the below and use the version from gradle.properties
// version SDK_ARTIFACT_VERSION // version picked up from gradle.properties
String sdkVersion = System.getenv('SDK_VERSION') != null ? System.getenv('SDK_VERSION') : SDK_ARTIFACT_VERSION
publishing {
publications {
sdk(MavenPublication) {
@laithnurie
laithnurie / library-proguard.pro
Created September 19, 2022 15:27
library proguard
#
# This ProGuard configuration file illustrates how to process a program
# library, such that it remains usable as a library.
# Usage:
# java -jar proguard.jar @library.pro
#
# Specify the input jars, output jars, and library jars.
# In this case, the input jar is the program library that we want to process.