Skip to content

Instantly share code, notes, and snippets.

adhishlal / LazyColumnExample.kt
Last active January 13, 2022 11:10
LazyColumn in Jetpack Compose
View LazyColumnExample.kt
LazyColumn(modifier = Modifier.fillMaxWidth()) {
items(items = names) {
View Get KeyHash Android Kotlin
private fun printKeyHash() {
// Add code to print out the key hash
try {
val info = packageManager.getPackageInfo("YOUR_PACKAGE_NAME", PackageManager.GET_SIGNATURES)
for (signature in info.signatures) {
val md = MessageDigest.getInstance("SHA")
Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT))
} catch (e: PackageManager.NameNotFoundException) {
adhishlal / colors.xml
Created June 22, 2017 10:36
This is useful list of beautiful colour codes which you can directly use in your Android applications
View colors.xml
<?xml version="1.0" encoding="utf-8"?>
<color name="colorPrimary">@color/red_400</color>
<color name="colorPrimaryDark">@color/red_600</color>
<color name="colorAccent">@color/white</color>
<color name="white">#FFFFFF</color>
<color name="red_50">#FFEBEE</color>
<color name="red_100">#FFCDD2</color>
<color name="red_200">#EF9A9A</color>
adhishlal / Custom Toast Android
Last active April 17, 2017 05:15
This is a code for showing custom toast message in Android
View Custom Toast Android
private void customToast(String msg)
LayoutInflater inflater = getLayoutInflater();
View layout = inflater.inflate(R.layout.customtoast,
(ViewGroup) findViewById(;
ImageView image = (ImageView) layout.findViewById(;
TextView text = (TextView) layout.findViewById(;
View New Firebase Server Notification - Android
// API access key from Google API's Console
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
'body' => 'here is a message. message',
'title' => 'This is a title. title',
'vibrate' => 1,
View Google Analytics Referer Tracking ADB command
adb shell am broadcast -a
-n ""
--es referrer "utm_source=email&utm_medium=email_marketing&utm_campaign=summer&tl_referral=190"