Skip to content

Instantly share code, notes, and snippets.

View androidmalin's full-sized avatar
☺️
The first step is as good as half over

androidmalin

☺️
The first step is as good as half over
View GitHub Profile
onCreateView(...) {
viewLifecycleOwner.lifecycleScope.launch {
viewLifecycleOwner.lifecycle.repeatOnLifecycle(STARTED) {
myViewModel.myUiState.collect { ... }
}
}
}
@cketti
cketti / android-28-sources.md
Created August 7, 2018 16:21
Build your own android-28 sources

Build "Sources for Android 28" so you can comfortably browse the Android API source in Android Studio.

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base
@ricknout
ricknout / CanvasMultilineText.kt
Last active October 13, 2022 12:01
A set of Kotlin extension functions and helper classes for drawing multiline text to Canvas on Android
package com.nickrout.canvasmultilinetext
import android.graphics.Canvas
import android.os.Build
import android.support.annotation.RequiresApi
import android.text.*
import androidx.core.graphics.withTranslation
import androidx.core.util.lruCache
@RequiresApi(Build.VERSION_CODES.O)
@cketti
cketti / android-27-sources.md
Created December 18, 2017 04:07
Build your own android-27 sources

Build "Sources for Android 27" so you can comfortably browse the Android API source in Android Studio.

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base
@cketti
cketti / android-26-sources.md
Last active August 14, 2019 12:08
Build your own android-26 sources

If you are annoyed that "Sources for Android 26" are not yet available via SDK manager, this might be for you:

  1. Collect source files
mkdir android-sdk-source-build
cd android-sdk-source-build

mkdir -p frameworks/base
@blundell
blundell / clear-android-things-apps.sh
Last active April 22, 2022 17:23
Uninstall all apps on an Android Device that have the intent-filter category IOT_LAUNCHER
#!/bin/bash
sp="/-\|"
sc=0
spin() {
printf "\b${sp:sc++:1}"
((sc==${#sp})) && sc=0
}
endspin() {
printf "\r"
}
@varhub
varhub / Android - Enable ADB from recovery.md
Created December 23, 2016 17:54
Android - Enable ADB from recovery

Android - Enable ADB from recovery

Credits to @TheOnlyAnil-@Firelord[^stackoverflow]

  • Requirements: a) stock recovery + rooted phone b) custom recovery

  • Files changed:

@kookxiang
kookxiang / hackQQ.sh
Last active March 18, 2025 18:30
一键得到一个精简版的手机QQ(Android)
#!/system/bin/sh
# 使用方法:
# adb shell "curl -Ssl https://gist.githubusercontent.com/kookxiang/1104e898f270c9a7a0784f70979ec532/raw/hackQQ.sh | su"
# 使用方法 (手动):
# 0.确保你手机 Root 了
# 1.下载这个脚本到某个地方
# 2.下载 Android SDK(需要其中的 adb)
# 3.在命令行运行 adb devices,确保能看到你的手机
#!/bin/python3
import os
print("AVD Launcher with replaced libs\nBy Nick Webster http://nick.geek.nz\n====================\n")
print("Note: You should be in your Android SDK tools folder when running this script.")
AVDs = [file.split('.')[0] for file in os.listdir(os.path.expanduser('~/.android/avd/')) if file.split('.')[len(file.split('.'))-1] == 'ini']
i = 0
for avd in AVDs: